Quality

<< Click to Display Table of Contents >>

 

Quality

An OPC Quality is composed by 8 (eight) bits, divided into 3 (three) fields, described on the next table.

Fields of an OPC quality

Status

Sub-Status

Limit

b7

b6

b5

b4

b3

b2

b1

b0

0: Bad

0: Non-specific, 1: Configuration error, 2: Not connected, 3: Device failure, 4: Sensor failure, 5: Last known value, 6: Communication failure, or 7: Out of service

0: Free, 1: Low, 2: High, or 3: Constant

1: Uncertain

0: Non-specific, 1: Last usable value, 4: Inaccurate sensor, 5: Engineering units exceeded, or 6: Sub-normal

3: Good

0: Non-specific, 1: Local overwriting, 6: Local timestamp (defined by this Driver), or 7: Local overwriting and timestamp (defined by this Driver)

 

The quality bits defined in protocol IEC 870-5-104 are mapped in the Quality property of a Tag. The higher bits on the list have greater precedence. For example, if bits IV and NT are turned on, the bit IV is returned. The mapping of bits is the following:

IV (invalid): If this bit is turned on, then quality is equal to 4 (four, Status equal to Bad, Sub-Status equal to Configuration Error, and Limit equal to Free)

NT (non-topic): If this bit is turned on and the bit IV is turned off, then quality is equal to 8 (eight, Status equal to Bad, Sub-Status equal to Not Connected, and Limit equal to Free)

SB (replaced): If this bit is turned on and quality is good (Status equal to Good), then changes Sub-Status to Local Overwriting, that is, sums 4 (four) to quality

BL (blocked): If this bit is turned on, adds 3 (three, Limit equal to Constant) to quality, without changing Status and Sub-Status

OV (overflow): If this bit is turned on and the bit BL is turned off, adds 2 (two, Limit equal to High) to quality. If the Map Overflow bit to Uncertain Quality option is configured, changes Status to Uncertain and Sub-Status to Engineering Units exceeded

Timestamp IV (ASDU came without timestamp, or if the timestamp had the flag IV (invalid) turned on): If quality is good (Status equal to Good), then changes Sub-Status from 0 (zero, Non-specific) to 6 (six, Local timestamp) or from 1 (one, Local overwriting) to 7 (seven, Local overwriting and timestamp)

 

The next table contains the combinations of flags received by this Driver and the resulting quality of data read.

Combinations of flags received by this Driver

IV

NT

SB

BL

OV

Timestamp IV

Quality

1

x

x

0

0

x

4: Bad / Configuration Error / Free (00 0001 00)

0

1

6: Bad / Configuration Error / High (00 0001 10)

1

x

7: Bad / Configuration Error / Constant (00 0001 11)

0

1

x

0

0

x

8: Bad / Not connected / Free (00 0010 00)

0

1

10: Bad / Not connected / High (00 0010 10)

1

x

11: Bad / Not connected / Constant (00 0010 11)

0

0

0

0

0

0

192: Good / Non-Specific / Free (11 0000 00)

0

1

194: Good / Non-Specific / High (11 0000 10)

1

x

195: Good / Non-Specific / Constant (11 0000 11)

0

0

1

0

0

0

196: Good / Local Overwriting / Free (11 0001 00)

0

1

198: Good / Local Overwriting / High (11 0001 10)

1

x

199: Good / Local Overwriting / Constant (11 0001 11)

0

0

0

0

0

1

216: Good / Local Timestamp / Free (11 0110 00)

0

1

218: Good / Local Timestamp / High (11 0110 10)

1

x

219: Good / Local Timestamp / Constant (11 0110 11)

0

0

1

0

0

1

220: Good / Local Overwriting and Timestamp / Free (11 0111 00)

0

1

222: Good / Local Overwriting and Timestamp / High (11 0111 10)

1

x

223: Good / Local Overwriting and Timestamp / Constant (11 0111 11)

 

Inversely, when an application performs writings to this Driver, the quality from a Tag is transformed into the corresponding bits of the protocol according to the previous table, only replacing the x from the table by the value 0 (zero). For example, a quality 4 (four) results in bit IV equal to 1 (one), in bit NT equal to 0 (zero), in bit SB equal to 0 (zero), in bit BL equal to 0 (zero), in bit OV equal to 0 (zero), and in bit Timestamp IV equal to 0 (zero). The next exceptions must be observed in the quality of writings:

Any Good quality not listed on the previous table is mapped with all flags in 0 (zero), except for flags BL and OV, which can always be extracted from quality

Any Bad or Uncertain quality not listed on the previous table is mapped with the flag IV equal to 1 (one) and all other flags in 0 (zero), also except for flags BL and OV

Sending invalid timestamps by this Driver is not supported, the timestamp sent is always valid, that is, the flag IV is equal to 0 (zero). Then, Sub-Status Local Timestamp (qualities 216, 218, and 219) and Local Overwriting and Timestamp (qualities 220, 222, and 223) are remapped to Non-Specific Sub-Status (qualities 192, 194, and 195)

Was this page useful?