OPC DA Quality Codes
What do the OPC DA Quality Codes indicate?
The OPC quality code is made up of 16 bits.
- The high 8 bits are available for vendor specific use and should be all 0's when not used.
- The low 8 bits are broken into three sections:
- The first two bits can pass the meaning Good, Bad or Uncertain. If a server does not support quality codes, a good value will always be passed.
- The next four bits can be used to provide additional specific information about the general quality.
- The last two bits are used if limit information is supported by the server.* In VB these are returned as Hex values that can them be converted to meaningful information.
The two most common OPC quality codes are:
- 192 or hex C0 is good quality.
- 0 (decimal or hex) is bad quality.
Below is a listing of the OPC specification quality codes:
| Hex Value | Decimal value | OPC Specification Definition |
| C0 | 192 | Good |
| D8 | 216 | Good--Local Override, Value Forced |
| 0 | 0 | Bad |
| 4 | 4 | Bad - Configuration Error in Server |
| 8 | 8 | Bad - Not Connected |
| C | 12 | Bad - Device Failure |
| 10 | 16 | Bad - Sensor Failure |
| 14 | 20 | Bad - Last Know Value Passed |
| 18 | 24 | Bad - Comm Failure |
| 1C | 28 | Bad - Out of Service (also happens when item or group is inactive) |
| 40 | 64 | Uncertain |
| 44 | 68 | Uncertain - Last Usable Value - timeout of some kind |
| 50 | 80 | Uncertain - Sensor not Accurate - outside of limits |
| 54 | 84 | Uncertain - Engineering Units exceeded |
| 58 | 88 | Uncertain - Value from multiple sources -----------with less then required good values |
*If limit quality is supported, then the above numbers mean the value can change:
- If the value is one greater - value is pegged at Lower Limit
- If the value is two greater - value is pegged at High Limit
- If the value is three greater - value is constant - can't change
For more information see the OPC specifications. (Note: not all servers will support all these codes)