Data quality information
- Last UpdatedMay 21, 2025
- 3 minute read
The OPC Data Access standard specifies a set of quality flags. PI Interface for OPC DA translates the quality flags to the closest approximation in the default System digital state set. The low eight bits of the quality flags are arranged into three fields, quality (QQ), sub-status (SSSS) and limit status (LL), arranged as follows: QQSSSSLL.
Handling data of questionable quality
PI Interface for OPC DA stores either the quality or the value in a PI point, whereas the OPC server returns value and quality in separate fields. If a value is good, it is stored in the point. If a value is bad, a digital state that describes the quality is stored. For questionable-quality data, you can configure the interface to treat the values as good and store them, or treat them as bad and store a digital state. You cannot configure the interface to store a bad-quality value.
To configure handling of questionable-quality data using PI ICU, go to the OPCInt > OPC Server page and enable the desired option, as shown in the following figure.
Storing both values and quality information
To record both the values reported and the quality information returned with the values, store the quality in a separate PI point. To configure a point to store the quality for the associated ItemID, set location2 to 4. Because OPC qualities are unsigned 16-bit integers, the PI Interface for OPC DA requires an Int32 tag to store them. The qualities are stored in Data Archive without any change, and their status is always . For details about OPC quality values, download the OPC Data Access specification from the OPC Foundation website or consult the PI_OPCClient User’s Guide.
Quality states
Quality data is composed of three sub-fields. The following tables list the values that are returned.
Good quality
|
Quality |
OPC Definition |
PI System Status |
|---|---|---|
|
11SSSSLL |
Non-specific |
|
|
Except: 110110LL |
Local Override |
|
* These values will be marked as questionable, unless you use the following switches to ignore questionable values.
-
If you use /SG=S, then "Local Override" is treated as good. However, it also suppresses bad and questionable values.
-
/SQ=I writes questionable values but suppresses the questionable flag, so that they appear in PI as if they were good.
Not used by OPC
|
Quality |
OPC Definition |
PI System Status |
|---|---|---|
|
10SSSSLL |
Invalid |
|
Questionable quality
|
Quality |
OPC Definition |
PI System Status |
|---|---|---|
|
LL |
Sub-Normal |
|
|
LL |
Engineering Units Exceeded |
|
|
LL= |
Low Limited |
|
|
LL= |
High Limited |
|
|
Otherwise |
|
|
|
LL |
Sensor Not Accurate |
|
|
LL= |
Low Limited |
|
|
LL= |
High Limited |
|
|
Otherwise |
Out of calibration (if not under or over range) |
|
|
LL |
Invalid |
|
|
LL |
Invalid |
|
|
LL |
Last Usable Value |
|
|
LL |
Non-specific |
|
Bad quality (PI version 3.3 and higher)
|
Quality |
OPC Definition |
PI System Status |
|---|---|---|
|
LL |
Out of Service |
|
|
LL |
Comm Failure |
|
|
LL |
Last Known Value |
|
|
LL |
Sensor Failure |
|
|
LL |
Device Failure |
|
|
LL |
Not Connect |
|
|
LL |
Configuration Error |
|
|
LL |
Non-specific |
|
Custom digital states
To replace the default PI System digital states with custom states using PI ICU, go to the OPCIntData Handling page and set the Alternate Digital State for Questionable/Bad Qualities field. To override the default states, you must specify the full set of replacements, and the numeric values must be contiguous.
The following table lists the digital states and PI statuses that you can override.
|
Order After Marker State |
Default PI status |
|---|---|
|
1 |
Bad_Quality |
|
2 |
Under LCL |
|
3 |
Over UCL |
|
4 |
Inp OutRange |
|
5 |
Under Range |
|
6 |
Over Range |
|
7 |
Invalid Data |
|
8 |
Bad Input |
|
9 |
No_Sample |
|
10 |
Doubtful |
|
11 |
Out of Service |
|
12 |
Comm Fail |
|
13 |
Scan Timeout |
|
14 |
Equip Fail |
|
15 |
Unit Down |
|
16 |
Not Connect |
|
17 |
Configure |
|
18 |
Bad |