Output Adapters and Input adapters limit

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.

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

1 Like

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

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.

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

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.

-- 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.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

Thanks,
Stephen

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

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