Quality-WORD format specification
The TwinCAT Quality components are coded in WORD in the following way:
Bit | Component | Type | Value range | Description |
---|---|---|---|---|
0 | BIT | 0..1 | Validity MSB. | |
1 | BIT | 0..1 | Validity LSB. | |
2 | Overflow | BIT | 0..1 | Overflow. |
3 | OutOfRange | BIT | 0..1 | Not in permissible range. |
4 | BadReference | BIT | 0..1 | Incorrect reference. |
5 | Oscillatory | BIT | 0..1 | Oscillating. |
6 | Failure | BIT | 0..1 | Failure. |
7 | OldData | BIT | 0..1 | Data not up to date. |
8 | Inconsistent | BIT | 0..1 | Inconsistent. |
9 | Inaccurate | BIT | 0..1 | Inaccurate. |
10 | BIT | 0..1 | Source (‘0‘:=process, ‘1‘:=replaced). | |
11 | Test | BIT | 0..1 | Test. |
12 | OperatorBlocked | BIT | 0..1 | Operator blocked. |
13..15 | Reserved | BIT | 0 | Are not used. |
Coding of the Quality.Validity components:
Value | Validity0 | Validity1 | STRING(2) | Description |
---|---|---|---|---|
Good | 0 | 0 | ‘00‘ | Good (default value). |
Invalid | 0 | 1 | ‘01‘ | Invalid. |
Reserved | 1 | 0 | ‘10‘ | Reserved. |
Questionable | 1 | 1 | ‘11‘ | Questionable. |
Coding of the Quality.Source components:
Value | Source | STRING(1) | Description |
---|---|---|---|
Process | 0 | ‘0‘ | Value comes from the process (default value). |
Substituted | 1 | ‘1‘ | Value was replaced. |
Samples
The table below contains strings and the values of the components after conversion to the structured type: ST_AcsiQuality.
WORD | STRING(18) | ST_AcsiQuality | Description |
---|---|---|---|
2#0000000000000000 | 'Q#00|00000000|0|00' | STRUCT(0) | All components have the value: 0. |
2#0001001100110010 | 'Q#01|00110011|0|01' | STRUCT(Validity0:=0, Validity1:=1, BadReference:=1, Oscillatory:=1, Inconsistent:=1, Inaccurate:=1, Source:=0, OperatorBlocked:=1) | Validity: Invalid. Source: Process. BadReference, Oscillatory, Inconsistent, Inaccurate, OperatorBlocked are set. All other components have the value: 0. |
2#0000110011001101 | 'Q#10|11001100|1|10' | STRUCT(Validity0:=1, Validity1:=0, Overflow:=1, OutOfRange:=1, Failure:=1, OldData:=1, Source:=1, Test:=1) | Validity: Reserved. Source: Replaced. Overflow, OutOfRange, Failure, OldData, Test are set. All other components have the value: |