ClearSCADA uses OPC standard quality definitions for the many quality database fields, including 'CurrentQuality' and 'PreviousQuality' point fields (also for 'PutAsideQuality' in ClearSCADA 2007 R1 and later). By using the relevant mask you can get at the quality, status and limit bits:
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 [ Historic Data Access Quality ] [ Data Access Quality ] [ Q ] [ S ] [ L ]
Where:
- Q is the (Data Access) Quality Field.
- S is the (Data Access) Status Field.
- L is the (Data Access) Limit Field.
Quality Mask
Dec Hex 192 0xC0 -------------------- OPC Quality Mask
Quality Bit Fields
Dec Hex 0 0x00 -------------------- Bad 64 0x40 -------------------- Uncertain 192 0xC0 -------------------- Good
Status Mask
Dec Hex 252 0xFC -------------------- OPC Status Mask
Status Bit Fields
Dec Hex
4 0x04 -------------------- Bad - Configuration Error in Server
8 0x08 -------------------- Bad - Not Connected
12 0x0C -------------------- Bad - Device Failure
16 0x10 -------------------- Bad - Sensor Failure
20 0x14 -------------------- Bad - Last Known Value Passed
24 0x18 -------------------- Bad - Comm failure
28 0x1c -------------------- Bad - Item Set InActive
32 0x20 -------------------- Bad - Waiting for Initial Data
68 0x44 -------------------- Uncertain - Last Usable Value - timeout of some kind
80 0x50 -------------------- Uncertain - Sensor not Accurate - outside of limits
84 0x54 -------------------- Uncertain - Engineering Units exceeded
88 0x58 -------------------- Uncertain - Value from multiple sources - with less then required good values
216 0xD8 -------------------- Good - Local Override, Value Forced
Limit Mask
Dec Hex 3 0x03 -------------------- OPC Limit Mask
Limit Bit Fields
Dec Hex 0 0x00 -------------------- Ok 1 0x01 -------------------- Low 2 0x02 -------------------- High 3 0x03 -------------------- Const
Historic Data Access Quality
Dec Hex 0 0x00000000 -------------- More than one piece of data that may be hidden exists at same timestamp. 1 0x00010000 -------------- Interpolated data value. 2 0x00040000 -------------- Raw data value. 3 0x00080000 -------------- Calculated data value, as would be returned from a ReadProcessed call. 3 0x00100000 -------------- No data found to provide upper or lower bound value. 3 0x00200000 -------------- No data collected. Archiving not active (for item or all items). 3 0x00400000 -------------- Collection started / stopped / lost. 3 0x00800000 -------------- Scaling / conversion error. 3 0x01000000 -------------- Aggregate value is for an incomplete interval.
Visual Representation
[ Data Access Quality ] 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 [ L ] Limit Bits 0 0 Not Limited 0 1 Low Limited 1 0 High Limited 1 1 Constant [ Q ] [ S ] Quality and SubSatus 0 0 [ S ] Bad Quality 0 0 0 0 Non Specific 0 0 0 1 Configuration Error 0 0 1 0 Not Connected 0 0 1 1 Device Failure 0 1 0 0 Sensor Failure 0 1 0 1 Last Known Value 0 1 1 0 Comm Failure 0 1 1 1 Out of Service 1 0 0 0 Waiting for Initial Data 1 x x x (S9-S15 is Reserved) 0 1 [ S ] Uncertain 0 0 0 0 Not Specified 0 0 0 1 Last Used Value 0 0 1 x (Not used in OPC) 0 1 0 0 Sensor Not Accurate 0 1 0 1 Engineering Unite Exceeded 0 1 1 0 Sub-Normal . . . . (S7-S15 is Reserved) 1 0 [ S ] (Not used in OPC) 1 1 [ S ] Good 0 0 0 0 Not Specified . . . . (S2-S5 are not used in OPC) 0 1 1 0 Local Override . . . . (S7-S15 is Reserved) [ Historic Data Access Quality ] 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 1 More than one data on this timestamp 1 Interpolated 1 Raw Data Value 1 Calculated 1 No data found to provided upper or lower bound value 1 No data found 1 Data Lost - Collection started/stoped/lost 1 Scaling/Conversion Error 1 Aggregate Value is for an incomplete interval
This information was taken from:
- OPC Data Access Custom Interface, Version 3.0, section 6.8 (page 160)
- OPC Historical Data Access Specification, Versions 1.2, section 5.1 (page 112).
Comments (1)
Feb 08, 2012
Adam Woodland says:
There are vendor specific additions, i.e.: Bit 31 (mask 0x80000000) means "Time...There are vendor specific additions, i.e.:
Bit 31 (mask 0x80000000) means "Timed Out", or "No data could be provided because the search timed out".
Bit 30 (mask 0x40000000) means "No raw data", or "The value is after that last raw data record". Used in processed data calculations.