<< Click to Display Table of Contents >> Navigation: Modbus Universal MasterOPC Server > Lua 5.1 Reference Manual > Examples and Other Useful Things > Example 1. Processing a quality > Problem statement |
Data in the float format are received from a Modbus device. Registers from 0 to 1 of the Holding Registers region are read out.
The register 2 of the same region stores a measurement status; a data type of that variable is uint16. If the device detects a broken sensor, the lower bit (bit 0) of the register becomes True. If short circuit of sensor is detected, the bit 1 changes to True. If ADC failure is detected, the bit 2 becomes True.
Failure type |
Bit number |
Broken sensor |
0 |
Short circuit of sensor |
1 |
ADC failure |
2 |
Basing on a value of that register, it is required to form a quality tag of a value measured.