Quality - property of object Var

The property returns the quality of the data item value. The values are identical with the stanndard quality values OPC.
Quality As Byte
n = oData.Item("dat1").Quality
The value according to the OPC specification consists from three informations:
- specifies if the value is Bad (value <64), Uncertain (value >=64 and <192) or Good (value >=192).
- specifies closer reason (see the table).
- specifies the relation to the limits: when the value 0 is added to the table value, then the value is not limited. When 1 is added, then the value is on low limit, 2 on high limit and 3 means that the value is constant and cannot be changed.
The following data correspond to the recommended values according to the OPC specification:
0 (&h0) - Bad: Non-specific - Bad value with unspecified reason.
4 (&h4) - Bad: Configuration Error - There is some server specific problem with the configuration. For example the item has been deleted from the configuration.
8 (&h8) - Bad: Not Connected - The input is required to be logically connected but it isn't.
12 (&hC) - Bad: Device Failure - A device failure has been detected.
16 (&h10) - Bad: Sensor Failure - A sensor failure had been detected.
20 (&h14) - Bad: Last Known Value - Communication has failed. However, the last known value is available. The 'age' of the value may be determined from the TimeStamp.
24 (&h18) - Bad: Comm Failure - Communication has failed. There isn't the last known value available.
28 (&h1C) - Bad: Out of Service - The block is off the scan or otherwise locked.
32 (&h20) - Bad: Waiting for Initial Data - Wrong value. The value has not been read from the communication so far, or the opposite side does not have the correct initial value.
64 (&h40) - Uncertain: Non-specific - There is no specific reason why the value is uncertain.
68 (&h44) - Uncertain: Last Usable Value - The return value should be regarded as 'stale'. The 'age' of the value may be determined from the TimeStamp.
80 (&h50) - Uncertain: Sensor Not Accurate - The sensor is out of the calibration.
84 (&h54) - Uncertain: Engineering Units Exceeded - The value is outside the limits defined for this parameter.
88 (&h58) - Uncertain: Sub-Normal - The value is derived from multiple sources and has less than the required number of Good sources.
192 (&hC0) - Good: Non-specific - The value is good. There are no special conditions.
216 (&hD8) - Good: Local Override - The value has been Overridden. Typically this means that the input has been disconnected and a manually entered value has been 'forced'.
Property access for read and write. The value of this property can be also obtained in the INFO system in "PmRoot" item (when looking into the object with this property).
The quality of data item in objects:
- In PmOpcClientData and PmCommData objects, the quality is filled in automatically when receiving the value from the communication. At application launch, the quality is set to "32=Bad:WaitForInitialData". If the requested data will not reach the PmCommData object, then the quality is set to "24=Bad:CommFailure".
- In the PmData object, the quality is filled in automatically only if the data item has the ExtOpcClient extension, or ExtComm and then, at application launch the quality is set to "32=Bad:WaitForInitialData".

If this item does not have the data extension, then the quality is set to "192=Good:NonSpecific" at application start. The designer is then able to set the quality directly by writing into this property.

- In the PmTrend and PmCommMsg objects, the quality is not filled in automatically and at application start, the quality is set to "192=Good:NonSpecific". The designer is able to set teh quality directly by writing into this property, but for the purposes of trending or communication, this quality does not influence anything.
The value quality test of the "Power" data item
If pMe.Pm("/BoilerPlant/Data/#vars/Power").Quality >= 192 Then
  ' The value quality is OK (Good)
End If
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice