Applies To:
  • CitectSCADA 3.xx, 4.xx

Summary:
How can I address a bit directly in a register of my PLC using the Modbus or MBPlus protocols? 

Solution:
Whilst you can remap the register, the best method is to modify the Modbus.dbf file in the BIN directory as follows:

Modify from this:

TEMPLATE UNIT_TYPE RAW_TYPE BIT_WIDTH LOW HIGH   COMMENT
0%U      1         0        1         1   99999  Output Coils Status
1%U      2         0        1         1   99999  Input Coils Status
3%U      4         1        16        1   99999  Input Registers
4%U      3         1        16        1   99999  Output Registers

To this:

TEMPLATE UNIT_TYPE RAW_TYPE BIT_WIDTH LOW HIGH   COMMENT
0%U      1         0        1         1   99999  Output Coils Status
1%U      2         0        1         1   99999  Input Coils Status
3%U[.%u] 4         1        16        1   99999  Input Registers
4%U[.%u] 3         1        16        1   99999  Output Registers

This will allow you to address a bit directly. For example to specify bit 5 in Output register 40001 address it as 40001.5 in the variable tags address field.

See also Q2355.

 

Keywords:
 

Attachments