Industry Automation and Control Forum
This forum is addressing industrial automation design & engineering, operations, asset performance, cyber security and digital transformation for Plants & Machines.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-06-14 03:28 PM
Dear colleagues,
I'm an electrical engineering student. For my thesis in Industrial automation, i'm trying to connect several devices from Schneider Electric using Modbus TCP/IP, such as 2 new M241 PLCs and 2 old TSX premium PLCs connected to a private network using a simple switch. I'm stuck in my first step which is the message exchange between the 2 TSX premium devices (TSX57102 and TXS57103 throughout the TCPIP MODULE TSX ETY110). I'm using the PL7 V4.4 software and implementing the Write_VAR and Read_VAR functions. Despite the layout differences between Unity and PL7 software, the structure is very similar. I'm able to use the WRITE_VAR function to send to 2 registers (e.g. WRITE_VAR(ADR#{1.102}1.0.101, ‘%MW’, 1, 4, %MW100:4, %MW50:4)) from the TSX57102 to TXS57103 and the communications are doing well. In the report registers ( %MW50, %MW51, %MW52, %MW53) I see no mistakes and the %MW53 indicates 12 words in the correct message length (and updates the TXS57103 slave device correctly). Nevertheless, when I use the READ_VAR(ADR#{1.102}1.0.101, ‘%MW’, 200, 4, %MW400:4, %MW60:4) to read the content of %MW200 to %MW203 in the slave device, the report registers ( %MW60, %MW61, %MW62, %MW63) show no mistakes except for the %MW63 register showing that the message length is zero, and I cannot obtain any value from the TXS57103 slave device. This is blowing my mind. How it is possible to write to a slave and not read using the same address? I've been trying different MW registers and nothing works... Am I using the wrong Master address since the WRITE_VAR function does not require any message (or ACK) feedback and the READ_VAR does? I should somehow authorize the Slave device to answer using any configuration or additional function? This is awkward since the main report registers (%MW60, %MW61) show no error, otherwise, they should present some error. The TX and RX leds from ETY modules are blinking indicating message exchange. Any idea of what's happening?
Thank you!
Armando Cordeiro
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-06-18 01:20 PM
I haven't used PL7 in a long time and sadly I don't have a functioning PL7 VM to open the projects where I have used READ_VAR and WRITE_VAR, but the syntax looks correct. I'm going to start with a dumb, obvious question - is the READ_VAR actually getting called?
Assuming it is, I think you might get a better idea of what is going on if you use WireShark to monitor the network traffic. You will need a switch that has port forwarding so it mirrors all switch traffic onto that port, and you plug your PC into that port on the switch. Then it will see all the network traffic. It has Modbus and IP filters to only show what you are interested in. If it is working properly, you will be able to see the establishment of the connection, the data request, and the response from the device. If it is not working, one of these will be missing, or the Modbus reply will have an error code.
Another useful diagnostic tool is Modbus Tester. It is super handy for doing a quick test to a slave device, and in conjunction with WireShark will show what a well formed request and reply should look like.
Video: What is Modbus Tester and how do I use it? | Schneider Electric USA
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-06-19 04:33 AM
I have never had the pleasure of using PL7, however in some other PLCs I've had to manually initiate the read length and timeout values in the read_var management array (in your case %MW60-%MW63). Try setting %MW62 to your desired timeout value and %MW63 to '4' for your read length. See if that jumpstarts your read_var block
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-06-20 01:56 AM
Thank you MatthewM and Bosswaffle. I'll try these options. In fact even the WRITE_VAR sometimes don't start normally. I've to go to the debug page and perform a ping connection with the slave device and after a while it starts to work. I suspect that might be a problem compatibility with the software version (PL7 v4.4) and the controllers firmware. I'm selecting in the PL7 software a controller with a different firmware version since the one that the controllers have in the side label are not available in the list.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.