This project has moved. For the latest updates, please go here.

OpenPDC Manager - Quality Flag Viewing

Nov 21, 2011 at 2:01 PM

Is there anyway within OpenPDC Manager to view the Signal's Quality Flag once it's set in a custom action adapter?

Nov 21, 2011 at 8:36 PM
Edited Nov 21, 2011 at 8:40 PM

Great question! I think the fair response is "not yet" - but what a nice feature. Even so you could add a method to your custom adapter so that you could query the last state of the last measurement yourself.

Note that any adapter method that is decorated with the "AdapterCommand" attribute can be invoked from the console:

        /// <summary>
        /// Resets the statistics of the specified device associated with this connection.
        /// </summary>
        /// <param name="idCode">Integer ID code of device on which to reset statistics.</param>
        [AdapterCommand("Resets the statistics of the device with the specified ID code.")]
        public void ResetDeviceStatistics(ushort idCode)
            if (m_definedDevices != null)
                ConfigurationCell definedDevice;
                if (m_definedDevices.TryGetValue(idCode, out definedDevice))
                    definedDevice.DataQualityErrors = 0;
                    definedDevice.DeviceErrors = 0;
                    definedDevice.TotalFrames = 0;
                    definedDevice.TimeQualityErrors = 0;
                    OnStatusMessage("Statistics reset for device with ID code \"{0}\" associated with this connection.", idCode);
                    OnStatusMessage("WARNING: Failed to find device with ID code \"{0}\" associated with this connection.", idCode);
                OnStatusMessage("Failed to reset statistics, no devices are defined.");

You can also type "LISTCOMMANDS" for an adapter to see what methods it can expose:


Adapter "SOURCEPDC" [Type = PhasorMeasurementMapper] Command List:

    SendCommand(TVA.PhasorProtocols.DeviceCommand command)
        Sends the specified command to connected phasor device.
        Resets the statistics of all devices associated with this connection.
    ResetDeviceStatistics(UInt16 idCode)
        Resets the statistics of the device with the specified ID code.
        Attempts to load the last known good configuration.
    LoadConfiguration(String configurationFileName)
        Attempts to load the specified configuration.
        Starts the adapter or restarts it if it is already running.
        Stops the adapter.
    SetInitializedState(Boolean initialized)
        Manually sets the intialized state of the adapter.

Here is an example of how to invoke the previous custom adapter command method from the console:

INVOKE 3 ResetDeviceStatistics 144

Command "ResetDeviceStatistics" successfully invoked.

[SOURCEPDC] Statistics reset for device with ID code "144" associated with this connection.


Nov 28, 2011 at 2:27 PM

Thanks Ritchie!