OpenPDC to OpenPDC communication


#16

I didn’t even notice the error date, sorry about that. It is odd that the error has not been recurring, since the session still returns no measurements.

When I go to the “Graph Measurements” tab on PDC2 I can see that the PMU does have measurements (e.g. Frequency, Phase Angle, etc.) However they are all just returning 0s.

I have not modified the outputmeasurements parameter. I completed the setup as prescribed by our previous conversations on this topic. I am a little lost on what is happening now.

Tyler


#17

So it sounds like the subscriber is subscribing to data, but the data is all zeros? I’ve never heard of that happening before. Would you be able to provide screenshots of the Graph Measurements screen from both PDCs for comparison? Pick the same frequency measurement on both so we can see the difference.

Thanks,
Stephen


#18

I will get those for you shortly. Quick question…PDC1 does have database authentication and login credentials…would this impact it at all?

Tyler


#19

No, I don’t think that would make a difference.


#20

Stephen,

Here are the pictures of the graph measurements screen.

PDC1:

PDC2:

I have selected the station frequency as the measurement to be compared.


#21

Okay, like I originally thought, it looks like it’s not subscribing to the data from PDC1. Here are some things you can check.


When the subscriber connects to the publisher, you should see some messages in the openPDC Console on the publisher system that look similar to the following.

[INTERNAL!DATAPUBLISHER] Start time sent to swills-desk.gpa.gridprotectionalliance.org ([::ffff:127.0.0.1]:46925).
[INTERNAL!DATAPUBLISHER] Client subscribed as compact unsynchronized with 138 signals.
[INTERNAL!DATAPUBLISHER] Received meta-data refresh request from swills-desk.gpa.gridprotectionalliance.org ([::ffff:127.0.0.1]:46925), preparing response...
[INTERNAL!DATAPUBLISHER] 258 records spanning 4 tables of meta-data prepared in 19 milliseconds, sending response to swills-desk.gpa.gridprotectionalliance.org ([::ffff:127.0.0.1]:46925)...

First, launch the openPDC Console on PDC1. Next, initialize the subscriber on PDC2. You should see the messages appear in the console on PDC1. Pay particular attention to the message that describes the number of signals the client subscribed to. If the message says it subscribed to 0 signals, then we know that it’s a problem with how the subscriber is evaluating the filter string in the OutputMeasurements connection string parameter.


You can query the database to determine what measurements the subscriber thinks it’s subscribing to. On PDC2, use the Browse Input Devices page, find and click on the subscriber device, and look at the connection string. At the end of that string, there should be a connection string parameter that defines the measurements the subscriber is subscribing to. It should look like this.

outputMeasurements={FILTER ActiveMeasurements WHERE Protocol = 'GatewayTransport' }

We can convert this string to a database query by replacing “FILTER ActiveMeasurements” with “SELECT * FROM ActiveMeasurement”. Note that the filter expression uses the plural ActiveMeasurements while the database uses the singular ActiveMeasurement.

SELECT * FROM ActiveMeasurement WHERE Protocol = 'GatewayTransport'

Execute that query against the database to get the list of measurements.


The next step would be to determine if the measurements returned by the subscriber query actually exist on the publisher, but we’ll start with this. If the publisher claims that the subscriber is subscribing to more than 0 signals, then we’re barking up the wrong tree. If the query returns no results, then we need to figure out why.

Thanks,
Stephen


#22

Stephen,

I am a bit confused on the process of querying the database. Am I supposed to put the query command into the console or should I literally replace it in the connection string and allow it to run from there? Thanks!

Tyler


#23

What database type are you using? SQLite?


#24

Stephen,

Yes the database is SQlite.


#25

It’s a bit of work, but you don’t need to install any special tools to run the query. Here are the steps.

  1. Use a text editor to open openPDC.exe.config in the openPDC installation directory.
  2. Search for the ConnectionString setting under the <systemSettings> section.
  3. The value of the connection string setting contains the full path to your SQLite database (e.g. Data Source=C:\path\to\openPDC.db). Save that path as we will be using it later.
  4. Open the Windows command prompt.
  5. Type cd /d C:\Program Files\openPDC\Database Scripts\SQLite, replacing C:\Program Files\openPDC with the path to the openPDC installation directory, and press Enter.
  6. Type echo SELECT * FROM ActiveMeasurement WHERE Protocol = 'GatewayTransport'; | sqlite3 -header -column C:\path\to\openPDC.db > C:\path\to\MeasurementDump.txt. Replace C:\path\to\openPDC.db with the path obtained from step 3. Replace C:\path\to\MeasurementDump.txt with a path to a file where you would like the command to write the results. Once the paths are right, press enter.

The results should be written to the file you specified in step 6.


#26

Hi Stephen,

When I do these steps I keep getting “Access is denied”

Tyler


#27

This is the command I’ve given the system. And the resulting denial.

C:\Program Files\openPDC\Database Scripts\SQLite>echo SELECT * FROM ActiveMeasurement WHERE Protocol = ‘GatewayTransport’; | sqlite3 -header -column C:\Users\ePDC Operator\Desktop\OpenPDC Archive\openPDC.db > C:\Users\ePDC Operator\Desktop\MDump1.txt
Access is denied.


#28

Does your user account have permissions to access the SQLite database file? You can try copying the file to another location and running the query against the copy.


#30

Ok, so using the copied database worked. I now have the dump text, and it appears that the system is subscribed to STAT 133 to 146 and PPA 147 to 231.


#31

The PPA measurements it is subscribed to seem to be all Phasor measurements available.


#32

FYI, I figured out what happened. Since the path to your database file had spaces, it parsed everything up to the space as the filename. you just needed to wrap it in quotes.

C:\Program Files\openPDC\Database Scripts\SQLite>echo SELECT * FROM ActiveMeasurement WHERE Protocol = 'GatewayTransport'; | sqlite3 -header -column "C:\Users\ePDC Operator\Desktop\OpenPDC Archive\openPDC.db" > C:\Users\ePDC Operator\Desktop\MDump1.txt

That may be important for this next step because we’re going to run a query against the publisher’s database.

Before I get into it, though, I thought I should confirm with you. Did you follow the steps using the openPDC Console to see how the publisher reported the number of subscribed signals?


#33

I have not been able to do that so far (PDC1 and PDC2 are in separate physical locations).

How do I initialize the subscriber on PDC2? I can try to work this out provided it is ok that I have about 5 minutes lag between each step that requires a change in PDC.

Tyler


#35

I was thinking you had remote desktop access to both systems. Instead, let’s open up the openPDC Console on PDC1 and type the following command. Don’t worry if a message comes in while you’re typing - just keep typing.

list internal!datapublisher

This should dump a huge amount of info to the console. What you’re looking for is a section like the following. There may be more than one of these sections, but you should be able to tell by the Subscriber ID which one is the subscriber from PDC2.

Status of IActionAdapter component 2, UnsynchronizedClientSubscription:

             Subscriber ID: swills-desk.gpa.gridprotectionalliance.org ([::ffff:127.0.0.1]:52045)
           Subscriber name:
        Subscriber acronym:
  Publish channel protocol: Tcp
      Data packet security: unencrypted

       Data source defined: True
    Referenced data source: Iaon, 21 tables
    Initialization timeout: 15,000 milliseconds
       Adapter initialized: True
         Operational state: Running
         Connect on demand: False
    Processed measurements: 200,434
    Total adapter run time: 2 minutes 42.6 seconds
       Temporal processing: Unsupported
   Item reporting interval: Every 100,000 items
                Adapter ID: 0
         Connection string: 14 key/value pairs

  TrackLatestMeasurements = False
     InputMeasurementKeys = cd61500f-fca9-4a9d-b472-77f8d11b1f55;e54f1c2a-5...
              DataChannel =
              IncludeTime = True
                  LagTime = 10
                 LeadTime = 5
  UseLocalClockAsRealTime = False
      StartTimeConstraint =
       StopTimeConstraint =
 TimeConstraintParameters =
       ProcessingInterval = -1
 UseMillisecondResolution = False
    RequestNaNValueFilter = False
             AssemblyInfo = source=GSF.TimeSeries; version=2.1.275; buildDa...

        Input measurements: 138 defined measurements

                     PPA:123
                     PPA:124
                     PPA:125
                     PPA:126
                     PPA:127
                     PPA:128
                     PPA:129
                     PPA:130
                     PPA:131
                     PPA:132
                       ...

        Defined frame rate: 0 frames/sec
      Measurement tracking: Disabled
  Respecting input demands: False
 Respecting output demands: True

The important line is the one that lists the number of input measurements.

        Input measurements: 138 defined measurements

#37

It appears that nothing is showing up other than the direct connected PMU and the PDC1 id.


#38
    3      INTERNAL!DATAPUBLISHER
                              Publishing data to 4 clients.

              Server state: Running
            Server runtime: 5 days 3 hours 18 seconds
         Connected clients: 4
           Maximum clients: Infinite
            Receive buffer: 8192
        Transport protocol: Tcp
        Text encoding used: US-ASCII
           Queued payloads: 0 for client 1
           Queued payloads: 0 for client 2
           Queued payloads: 0 for client 3
           Queued payloads: 0 for client 4
  Total adapter components: 5
    Collection initialized: True
    Initialization timeout: 15000 milliseconds
 Current operational state: Enabled
       Temporal processing: Unsupported
       Data source defined: True
    Referenced data source: Iaon, 21 tables
    Data source table name: [internal]
         Connection string: 4 key/value pairs

             SecurityMode = None
AllowSynchronizedSubscrip = false
       UseBaseTimeOffsets = true
     CacheMeasurementKeys = FILTER ActiveMeasurements WHERE SignalType = 'S...


Status of each INTERNAL!DATAPUBLISHER component:
-------------------------------------------------------------------------------

Status of IActionAdapter component 1, LatestMeasurementCache:
       Data source defined: True
    Referenced data source: Iaon, 21 tables
    Initialization timeout: 15,000 milliseconds
       Adapter initialized: True
         Operational state: Running
         Connect on demand: False
    Processed measurements: 0
    Total adapter run time: 5 days 3 hours 17.93 seconds
       Temporal processing: Unsupported
   Item reporting interval: Every 100,000 items
                Adapter ID: 0
         Connection string: 4 key/value pairs

  TrackLatestMeasurements = true
                  LagTime = 60
                 LeadTime = 60
     InputMeasurementKeys = FILTER ActiveMeasurements WHERE SignalType = 'S...

        Input measurements: 175 defined measurements

                      STAT:1
                      STAT:2
                      STAT:3
                      STAT:4
                      STAT:5
                      STAT:6
                      STAT:7
                      STAT:8
                      STAT:9
                     STAT:10
                       ...

        Defined frame rate: 0 frames/sec
      Measurement tracking: Enabled
  Respecting input demands: False
 Respecting output demands: True

Status of IActionAdapter component 2, UnsynchronizedClientSubscription:

             Subscriber ID: ttupdc.ttu.edu ([::1]:63187)
           Subscriber name:
        Subscriber acronym:
  Publish channel protocol: Tcp
      Data packet security: unencrypted

       Data source defined: True
    Referenced data source: Iaon, 21 tables
    Initialization timeout: 15,000 milliseconds
       Adapter initialized: True
         Operational state: Running
         Connect on demand: False
    Processed measurements: 0
    Total adapter run time: 49.74 seconds
       Temporal processing: Unsupported
   Item reporting interval: Every 100,000 items
                Adapter ID: 0
         Connection string: 11 key/value pairs

  TrackLatestMeasurements = False
          PublishInterval = -1
              IncludeTime = True
                  LagTime = 10
                 LeadTime = 5
  UseLocalClockAsRealTime = False
       ProcessingInterval = -1
 UseMillisecondResolution = False
    RequestNaNValueFilter = False
             AssemblyInfo = source=GSF.TimeSeries;version=2.1.264;buildDate...
     InputMeasurementKeys = FILTER ActiveMeasurements WHERE SignalType='ALRM'

        Defined frame rate: 0 frames/sec
      Measurement tracking: Disabled
  Respecting input demands: False
 Respecting output demands: True

Status of IActionAdapter component 3, UnsynchronizedClientSubscription:

             Subscriber ID: ttupdc.ttu.edu ([::1]:63189)
           Subscriber name:
        Subscriber acronym:
  Publish channel protocol: Tcp
      Data packet security: unencrypted

       Data source defined: True
    Referenced data source: Iaon, 21 tables
    Initialization timeout: 15,000 milliseconds
       Adapter initialized: True
         Operational state: Running
         Connect on demand: False
    Processed measurements: 1,544
    Total adapter run time: 43.05 seconds
       Temporal processing: Unsupported
   Item reporting interval: Every 100,000 items
                Adapter ID: 0
         Connection string: 11 key/value pairs

  TrackLatestMeasurements = True
          PublishInterval = 2
              IncludeTime = True
                  LagTime = 60
                 LeadTime = 60
  UseLocalClockAsRealTime = False
       ProcessingInterval = -1
 UseMillisecondResolution = False
    RequestNaNValueFilter = False
             AssemblyInfo = source=GSF.TimeSeries;version=2.1.264;buildDate...
     InputMeasurementKeys = 624a9d1b-9857-4ed1-80f4-9e6e68dce9b4;70385e2c-9...

        Input measurements: 71 defined measurements

                     PPA:256
                     PPA:254
                     PPA:255
                     PPA:259
                     PPA:262
                     PPA:258
                     PPA:260
                     PPA:261
                     PPA:257
                     PPA:297
                       ...

        Defined frame rate: 0 frames/sec
      Measurement tracking: Enabled
  Respecting input demands: False
 Respecting output demands: True

Status of IActionAdapter component 4, UnsynchronizedClientSubscription:

             Subscriber ID: ttupdc.ttu.edu ([::1]:63190)
           Subscriber name:
        Subscriber acronym:
  Publish channel protocol: Tcp
      Data packet security: unencrypted

       Data source defined: True
    Referenced data source: Iaon, 21 tables
    Initialization timeout: 15,000 milliseconds
       Adapter initialized: True
         Operational state: Running
         Connect on demand: False
    Processed measurements: 850
    Total adapter run time: 42.95 seconds
       Temporal processing: Unsupported
   Item reporting interval: Every 100,000 items
                Adapter ID: 0
         Connection string: 11 key/value pairs

  TrackLatestMeasurements = False
          PublishInterval = 2
              IncludeTime = True
                  LagTime = 60
                 LeadTime = 60
  UseLocalClockAsRealTime = False
       ProcessingInterval = -1
 UseMillisecondResolution = False
    RequestNaNValueFilter = False
             AssemblyInfo = source=GSF.TimeSeries;version=2.1.264;buildDate...
     InputMeasurementKeys = a67be298-61b6-43c3-9a1a-f7685f34ba32;04f87055-e...

        Input measurements: 175 defined measurements

                     STAT:104
                     STAT:180
                     PPA:263
                     PPA:304
                     STAT:336
                     STAT:341
                     STAT:110
                     PPA:269
                     PPA:310
                      STAT:1
                       ...

        Defined frame rate: 0 frames/sec
      Measurement tracking: Disabled
  Respecting input demands: False
 Respecting output demands: True

Status of IActionAdapter component 5, UnsynchronizedClientSubscription:

             Subscriber ID: ttupdc.ttu.edu ([::1]:63192)
           Subscriber name:
        Subscriber acronym:
  Publish channel protocol: Tcp
      Data packet security: unencrypted

       Data source defined: True
    Referenced data source: Iaon, 21 tables
    Initialization timeout: 15,000 milliseconds
       Adapter initialized: True
         Operational state: Running
         Connect on demand: False
    Processed measurements: 2,086
    Total adapter run time: 34.76 seconds
       Temporal processing: Unsupported
   Item reporting interval: Every 100,000 items
                Adapter ID: 0
         Connection string: 14 key/value pairs

  TrackLatestMeasurements = False
     InputMeasurementKeys = 88645bca-775c-4e51-8577-00cfd5068510;c3d58cbd-c...
              DataChannel =
              IncludeTime = True
                  LagTime = 3
                 LeadTime = 1
  UseLocalClockAsRealTime = False
      StartTimeConstraint =
       StopTimeConstraint =
 TimeConstraintParameters =
       ProcessingInterval = -1
 UseMillisecondResolution = False
    RequestNaNValueFilter = False
             AssemblyInfo = source=GSF.TimeSeries; version=2.1.264; buildDa...

        Input measurements: 2 defined measurements

                     PPA:255
                     PPA:296

        Defined frame rate: 0 frames/sec
      Measurement tracking: Disabled
  Respecting input demands: False
 Respecting output demands: True

-------------------------------------------------------------------------------
  Respecting input demands: False
 Respecting output demands: False
  Buffer block retransmits: 0





[PPA] 1,103,600,006 measurements have been processed so far...

State of process "HealthMonitor" has changed to "Processing".

State of process "HealthMonitor" has changed to "Processed".


Counter                  Last         Average       Maximum         Units
-------------------- ------------- ------------- ------------- ----------------
     CPU Utilization     0.31          0.64          1.95      Average % / CPU
       I/O Data Rate     21.12         57.28        284.19     Kilobytes / sec
   I/O Activity Rate    2089.41       2090.07       2373.48    Operations / sec
Process Handle Count    1423.00       1390.18       1911.00    Total Handles
Process Thread Count     53.00         51.27         56.00     System Threads
    CLR Thread Count     97.00         92.88        189.00     Managed Threads
   Thread Queue Size     0.00          0.00          0.00      Waiting Threads
Lock Contention Rate     0.00          0.01          0.60      Attempts / sec
Process Memory Usage    195.20        191.59        195.20     Megabytes
    CLR Memory Usage     72.98         72.91         73.95     Megabytes
   Large Object Heap     3.61          3.48          3.61      Megabytes
     Exception Count  5411554.00    5411470.00    5411554.00   Total Exceptions
      Exception Rate     0.00          0.25          3.40      Exceptions / sec
  IPv4 Outgoing Rate     89.74         64.85        155.78     Datagrams / sec
  IPv4 Incoming Rate     84.16         68.68        208.78     Datagrams / sec
  IPv6 Outgoing Rate     0.00          0.93          12.60     Datagrams / sec
  IPv6 Incoming Rate     0.00          0.01          1.80      Datagrams / sec

Statistics calculated using last 120 counter values sampled every 5.0 seconds.

[NI_STATION] 856,200,001 measurements have been processed so far...

This is what is showing. I do not see any mention of the connection between PDC1 and PDC2