Hello
I encountered a problem when connecting a Micrologix to a Siemens S7-1200 CPU using MODBUS RTU.
HW configuration is: Siemens S7-1200 with CM1241 connected via RS232 cable to Channel 2 of Micrologix 1400.
I have tried two solutions: 1) Micrologix as a slave, when S7-1200 writes data to holding registers of Micrologix, and 2) Micrologix as a master, when Micrologix reads data from holding registers of S7-1200. In both cases, I managed to successfully write/read data, if the length of elements (integer type) was 1. If I change the length to >1, the communication doesn't work. I'd like to copy several integers at once to the Micrologix.
I'd appreciate if anyone can share some insight on this matter.
Attached is the code.
I encountered a problem when connecting a Micrologix to a Siemens S7-1200 CPU using MODBUS RTU.
HW configuration is: Siemens S7-1200 with CM1241 connected via RS232 cable to Channel 2 of Micrologix 1400.
I have tried two solutions: 1) Micrologix as a slave, when S7-1200 writes data to holding registers of Micrologix, and 2) Micrologix as a master, when Micrologix reads data from holding registers of S7-1200. In both cases, I managed to successfully write/read data, if the length of elements (integer type) was 1. If I change the length to >1, the communication doesn't work. I'd like to copy several integers at once to the Micrologix.
I'd appreciate if anyone can share some insight on this matter.
Attached is the code.