montgomery169
I am a new to OpenPLC and think its an awesome tool. I am a little confused, Bits, Bytes, Ints, Longs, etc. do not appear to occupy the same registers. For example, My ModbusTCP device writes a value of 5 to %IW100. I would expect registers %IX200.0 and %IX200.2 to be true or 1. but they are not. This doesn't appear to work with %M registers either. Am I doing something wrong or simply mistaken thinking these register would occupy the same space?
Quote 0 0
thiagoralves
These addresses don’t occupy the same space on OpenPLC
Quote 0 0
AZSG

On OpenPLC
%IW are input registers (analog)
%IX  are discrete input registers. (digital)
They are both read only.
They are read with different function codes when polled using modbus TCP.

Function Code - Function
01 - READ COIL STATUS
02 - READ INPUT STATUS
03 - READ HOLDING REGISTERS
04 - READ INPUT REGISTERS
05 - WRITE SINGLE COIL
06 - WRITE SINGLE REGISTER
15 - WRITE MULTIPLE COILS
16 - WRITE MULTIPLE REGISTERS

Function codes 2 and 4.

Coils and Holding Registers are read using 1 and 3.

They are read/write, so you can write to them using function codes 5, 6, 15 and 16.

Thiago can confirm, but that is why they are not held in the same space.

Quote 0 0