# Output Adapters and Input adapters limit

**URL:** <http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332>\
**Category:** openPDC\
**Created:** [November 4, 2024, 12:07pm UTC](http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332 "2024-11-04T12:07:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BALAJI\_TS](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/balaji_ts/32/1277_2.png) [@BALAJI\_TS](http://discussions.gridprotectionalliance.org/u/BALAJI_TS)\
**Post date:** [November 4, 2024, 12:07pm UTC](http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332/1 "2024-11-04T12:07:25Z")

</div>

Greetings of the day,

I am currently using openPDC manager to send data to my PSQL database by creating output adapters. Is there any limit for configuring openPDC adapters? As I have multiple PMUs configured and each PMU has 14 measurements(Freq, Rocof, All 3 phase magnitude and angle) and i have to send all those measurments from each pmu to database.

So is there any limit for Input adapters and output adapters creation in openPDC Manager?

Thank You.

---

<div class="post-metadata">

**Author:** ![StephenCWills](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/stephencwills/32/20_2.png) [@StephenCWills](http://discussions.gridprotectionalliance.org/u/StephenCWills)\
**Post date:** [November 5, 2024, 5:48pm UTC](http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332/2 "2024-11-05T17:48:15Z")

</div>

Hello BALAJI\_TS,

The only limits you should encounter are resource limits on the system running openPDC. There is no practical upper limit on the number of adapters you can create.

Thanks,  
Stephen

---

<div class="post-metadata">

**Author:** ![BALAJI\_TS](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/balaji_ts/32/1277_2.png) [@BALAJI\_TS](http://discussions.gridprotectionalliance.org/u/BALAJI_TS)\
**Post date:** [November 26, 2024, 9:46am UTC](http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332/3 "2024-11-26T09:46:05Z")

</div>

Thank You Stephen for confriming it.

And I have one more doubt, are there any APIs for configuring Output/Input adapters in openPDC? Like without using openPDC manager GUI, can I create/modify adapters using API’s/Script?

Regars,  
Balaji TS

---

<div class="post-metadata">

**Author:** ![StephenCWills](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/stephencwills/32/20_2.png) [@StephenCWills](http://discussions.gridprotectionalliance.org/u/StephenCWills)\
**Post date:** [November 26, 2024, 2:09pm UTC](http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332/4 "2024-11-26T14:09:33Z")

</div>

We usually do it by writing SQL scripts. You can also reference the openPDC Manager source code to develop a C# app that does it.

---

<div class="post-metadata">

**Author:** ![BALAJI\_TS](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/balaji_ts/32/1277_2.png) [@BALAJI\_TS](http://discussions.gridprotectionalliance.org/u/BALAJI_TS)\
**Post date:** [November 27, 2024, 10:40am UTC](http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332/5 "2024-11-27T10:40:25Z")

</div>

Is there any example SQL script for creating the Input adapter and Output ADO adapters(for PSQL database)? Can you provide some sample scripts?

And from where can I download the openPDC Manager source code?

Thank You.

Regards,  
Balaji

---

<div class="post-metadata">

**Author:** ![StephenCWills](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/stephencwills/32/20_2.png) [@StephenCWills](http://discussions.gridprotectionalliance.org/u/StephenCWills)\
**Post date:** [November 27, 2024, 2:31pm UTC](http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332/6 "2024-11-27T14:31:57Z")

</div>

I recently made one for SQL Server, but it’s a bit messy, and I’m not sure how much I can share of it. Instead, here’s something like a skeleton for building one.

```sql
-- Create output measurements for each device
INSERT INTO Measurement(DeviceID, HistorianID, SignalTypeID, PointTag, SignalReference, Description, Enabled)
SELECT
    Device.ID DeviceID,
    Historian.ID HistorianID,
    SignalType.ID SignalTypeID,
    CONCAT(Device.Acronym, '!MY_OUTPUT:CV', ...) PointTag,
    CONCAT(Device.Acronym, '!MY_OUTPUT-CV', ...) SignalReference,
    '...' Description
FROM
    Device JOIN
    Historian ON Historian.Acronym = 'PPA' JOIN
    SignalType ON SignalType.Acronym = 'CALC' JOIN
    ...

-- Create the calculator adapter
INSERT INTO CustomActionAdapter (AssemblyName, TypeName, AdapterName, NodeID, Enabled, ConnectionString)
SELECT
    'DynamicCalculator.dll' AssemblyName,
    'DynamicCalculator.DynamicCalculator' TypeName,
    CONCAT('MY_OUTPUT_CALC!', Device.Acronym) AdapterName,
    Node.ID NodeID,
    1 Enabled,
    CONCAT
    (
        'FramesPerSecond=', Device.FramesPerSecond, '; ',
        'LagTime=1; LeadTime=3; ',
        'OutputMeasurements=', OutputMeasurement.SignalID, '; ',
        'VariableList={input=', InputMeasurement.SignalID, '}; ',
        'ExpressionText={input * 1.414}'
    ) ConnectionString
FROM
    Device JOIN
    Measurement OutputMeasurement ON
        Measurement.DeviceID = Device.ID AND
        Measurement.PointTag LIKE '%!MY_OUTPUT:%' JOIN
    Measurement InputMeasurement ON ...

```

* * *

The source code for openPDC Manager can be found in the gsf repository.  
[https://github.com/GridProtectionAlliance/gsf/tree/master/Source/Libraries/GSF.TimeSeries/UI](https://github.com/GridProtectionAlliance/gsf/tree/master/Source/Libraries/GSF.TimeSeries/UI)  
[https://github.com/GridProtectionAlliance/gsf/tree/master/Source/Libraries/GSF.PhasorProtocols/UI](https://github.com/GridProtectionAlliance/gsf/tree/master/Source/Libraries/GSF.PhasorProtocols/UI)

In particular, have a look at the `Adapter` class that serves as the data model for custom adapters.  
[https://github.com/GridProtectionAlliance/gsf/blob/10b5b05277d5c5caf70dcec3ac5340ae9cab71f5/Source/Libraries/GSF.TimeSeries/UI/DataModels/Adapter.cs#L527](https://github.com/GridProtectionAlliance/gsf/blob/10b5b05277d5c5caf70dcec3ac5340ae9cab71f5/Source/Libraries/GSF.TimeSeries/UI/DataModels/Adapter.cs#L527)

Thanks,  
Stephen

---

<div class="post-metadata">

**Author:** ![BALAJI\_TS](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/balaji_ts/32/1277_2.png) [@BALAJI\_TS](http://discussions.gridprotectionalliance.org/u/BALAJI_TS)\
**Post date:** [December 2, 2024, 11:58am UTC](http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332/7 "2024-12-02T11:58:17Z")

</div>

Thank You for providing the sql script Stephen.

I have few clarifications regarding running the scripts because I don’t have much knowledge on SQL. How can I use SQL script to create a Input/Output adapters in openPDC manager? After writing the SQL script, how can I link that script to openPDC?

Regards,  
Balaji TS

---

<div class="post-metadata">

**Author:** ![StephenCWills](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/stephencwills/32/20_2.png) [@StephenCWills](http://discussions.gridprotectionalliance.org/u/StephenCWills)\
**Post date:** [December 2, 2024, 5:55pm UTC](http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332/8 "2024-12-02T17:55:19Z")

</div>

The script I created inserts a record into the `CustomActionAdapter` table. To create input or output adapters, you’d have to instead insert records into the `CustomInputAdapter` or `CustomOutputAdapter` tables.

After writing the SQL script, you have to execute it against your database. In SQL Server, we typically use a tool called SQL Server Management Studio. As I recall, PostgreSQL has a similar tool called pgAdmin. Running the script will create the adapter records in the appropriate tables.

Once the new database records are inserted into the database tables, you can use openPDC Console to issue the `ReloadConfig` command. This tells the openPDC service to look in the database for updates to its runtime configuration. This process should automatically identify the newly added adapter rows, create the adapter instances based on that configuration, and initialize and start the new adapter instances.

Thanks,  
Stephen

---

<div class="post-metadata">

**Author:** ![BALAJI\_TS](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/balaji_ts/32/1277_2.png) [@BALAJI\_TS](http://discussions.gridprotectionalliance.org/u/BALAJI_TS)\
**Post date:** [December 20, 2024, 6:55am UTC](http://discussions.gridprotectionalliance.org/t/output-adapters-and-input-adapters-limit/1332/9 "2024-12-20T06:55:53Z")

</div>

Hello Stephen,

Thank you for providing the SQL script and the steps. Now I am able to create Input device and output adapter by using the sql scripts.

Regards,  
Balaji
