andrea199403 - 2025-10-21

Hello everyone, I am new to this forum and I am also new to Codesys programming.
My problem is this:
I have a STRUCT of 64 bool and 30 real, this STRUCT is assigned in the programme 9 times.
Now I need to communicate with an HMI via Modbus and I have defined the slave device and created the holding registers for communication.
I would like to declare the first call of the STRUCT on the Modbus registers %QX2000.0 to %QX2007.7
for the booleans and on the registers %QW1004 to %QW1034 for the real registers.
That said, I would like to change an index and set an offset of 100 bytes for the calls of the other 8 assignments, so that the result is:
%QX2100.0 to %QX2107.7
for the booleans and on the %QW1104 to %QW1134 registers for the Real registers, etc. Is there a way to declare this?
Thank you very much.

 

Last edit: andrea199403 2025-10-21