Applies To:
  • CitectSCADA 5.01 and greater

Summary:
When I set individual bits within an integer tag and read the tag, the integer value is incorrect. It indicates that the opposite bit was set than the one I selected. For example, if I set bit 4000.16 and read the tag at address, the value is 1 and if I set bit 4000.1, then the value at address 4000 is -32768. 

Solution:
Modbus stores bits within words in the reverse order to that which one would expect. Normally, Citect conforms to the Modbus standard, which doesn't have any ramifications when one reads an integer from an integer area or a digital from a digital area, etc. The problem of bit representation is only significant when you want to access individual bits within an integer tag. In this situation, the reverse internal representation of bits within Modbus tags is evident to the user.

The default way of accessing bits within words in Citect will always be according to the Modbus standard, i.e

4000.1 = 1 implies 4000 = -32768
4000.16 = 1 implies 4000 = 1

We have added an option in the "Modbus" section of the citect.ini file which allows for the accessing of bits within words in the logical way, i.e:

4000.1 = 1 implies 4000 = 1
4000.16 = 1 implies 4000 = -32768

In order to for this option to be activated, it is necessary to add the following section in the citect.ini file.

[Modbus]
RegisterBitReverse=1

To change back to the default, bit-swapped method, simply change the option to

[Modbus]
RegisterBitReverse=0

...or delete the option all together.

 

Keywords:
 

Attachments