Status codes

There are several status code registers available in Modbus system data registers. These are the System Status, Measurement Status, and Measurement Flag registers. These registers are bit fields, where each bit value has specific meaning. When there are no errors, all bits in the register will be cleared, and the register value will be 0 which indicates no error, or status OK. A value of 1 in any bit indicates an error or flag condition. If there is an error bit set, the register value will be an integer between 1-15 depending on the bit and its position value.

The System Status code describes system level problems, such as a motor error, or low voltage. The Measurement Status code describes issues that would be preventing a measurement from being taken, such as instability. And the Measurement Flags indicate potential problems with the reported measurement, such as uneven soiling being detected.

Convert the number in the status code to binary to see which bits are set. The following table describes the meaning of each bit in the status codes. Modbus system data registers also includes this error bit information.

Bit position (value)

System Status

Measurement Status

Measurement Flags

Bit 0 (Value =1)

Motor Error

Irradiance below Threshold

Soiling ratio measurement outside normal range

Bit 1 (Value = 2)

Motor Lockout (low voltage)

Irradiance is not stable enough to open

Soiling ratio rear measurement is out

Bit 2 (Value = 4)

Backup Battery Low Voltage

Open cover triggered by user

Uneven soiling detected on soiled Panel (DV10 only)

Bit 3 (Value = 8)

Reserved

Prevent Open triggered by user

Reserved

Decoding the Code Registers:

One way to decode the bits in the status codes is described here, with an example provided in the example program.

Method 1:

  1. Take the value in the code register.

  2. Subtract the largest possible bit value that does not make the result negative. That bit is set.

  3. Subtract the next largest bit value from the remainder. That bit is set.

  4. Continue this process until the result is zero. When the result reaches zero, the final bit is set, and the conversion is complete.

Method 2 (iterative approach):

  1. Start with the value in the code register.

  2. Subtract the highest bit value. Evaluate the result:

    • If the result is zero: That bit is set. Conversion is complete.

    • If the result is positive: That bit is set. Take the remainder as the new result and move to the next iteration with the next highest bit value.

    • If the result is negative: That bit is not set. Keep the same result and move to the next iteration with the next highest bit value.

  3. Repeat the process with each successive lower bit value until the result reaches zero, indicating the conversion is complete.

Example 1:

If the System Status code register returns the value of 6, this indicates that both Bit 2 and Bit 1 are set.

Decoding: 6

6 – 8 (Bit 3 value) < 0 (the value of Bit 3 is 8 which is too large). Don’t use

6 – 4 (Bit 2 value) = 2. So, bit 2 is set - Motor Lockout (low voltage)

2 – 2 (Bit 1 value) = 0. So, bit 1 is set – Backup Battery voltage is low

(Bit 0 is not set since the remainder above was 0)

Conversion done

Example 2:

If the Measurement Status register returns the value of 9, this indicates that Bit 3 and Bit 0 are set.

Decoding: 9

9 – 8 (Bit 3 value) = 1. Bit is set – Prevent Open triggered by user

1 – 4 (Bit 2 value) < 0. Don’t use

1 – 2 (Bit 1 value) < 0. Don’t use

1 – 1 (Bit 0 value) = 0. Bit is set – Irradiance below threshold

Conversion done. These bits indicate that a measurement will not occur because of those two conditions.