MVP 2023 Flex727 Posted March 1, 2013 MVP 2023 Report Posted March 1, 2013 I'm having some difficulty getting communications between several V570 PLCs. My desire is to have two Masters that each talk to a single slave (but not to each other directly) and have a 5th PLC acting as Master and talking to the two Master PLCs but treating them as slaves. I'm using MODBUS IP to communicate. I have had no problem getting all PLCs to communicate with a single Master and 4 Slaves, but can't get this arrangement to work. See attached drawing. I can get PLC2 & PLC3 talking to each other and PLC4 talking with PLC5. When I attempt to connect PLC1 to PLC2, they connect just fine (both PLCs show they're connected), but they won't exchange data. PLC1 shows a TXD to PLC2 but no RXD from PLC2. PLC2 shows a RXD from PLC1 but no TXD to PLC1. Is a V570 acting as both Master to one PLC and Slave to another not possible, or do I just have something awry in my setup? Other possibly important info: PLC1 is actually a V1210. PLC2-5 are V570s. I am using Visilogic 9.4.0 and Win 7 64-bit.
MVP 2023 Joe Tauser Posted March 1, 2013 MVP 2023 Report Posted March 1, 2013 Do you actually have them wired like that or do you have them all tied to a common switch? I haven't tried it in practice, but my first gut feeling is to set up separate sockets and port numbers for master and slave communication in each PLC. I opened up Visilogic and was able to define two Modbus IP config blocks. I set the first one to use socket 0 port 20000. This is the one I would use for the master. You do have to init the socket to use TCP and set it as a master. Then I dropped another Modbus IP config block and set it to socket 2, which is Modbus slave on port 502 by default. In the following network I dropped a ScanEX block using MODBUS_IP2. Try it and let us know if it works or if I'm on dope. Joe T. 1
MVP 2023 Flex727 Posted March 2, 2013 Author MVP 2023 Report Posted March 2, 2013 Thanks for the reply, Joe. Yes, they're all tied to a common ethernet switch - I should've mentioned that. The arrows in my picture were intended to denote line of communication, not actual ethernet cable. I used different actual port and socket numbers than you mention, but that is exactly what I did. I initialized two sockets in the Master/Slave PLCs with different port numbers and initialized a single matching port/socket in the Slave-only PLCs. Those PLCs communicate properly and exchange data. In the top Master PLC (the V1210), I initialized two sockets/ports, one for each of the Master/Slave PLCs (#2 & #4) and had one of the ports set as slave and the ScanEx block. The sockets initialize and connect and show as connected on all PLCs, but the Master/Slave PLCs (#2 & #4) do not respond to #1 with a TXD, though they show RXD from #1. There are so many settings that have to be exactly right across all the PLCs that it's very easy to miss something or make a typo that's difficult to find. I guess my primary question is, is this theoretically possible and it's not working because I have a setup issue, or is the situation of a single PLC acting as Master to one PLC, but Slave to another - and exchanging data with both - not a capability I should be expecting?
linxchas Posted March 4, 2013 Report Posted March 4, 2013 Your shema should work. Seems to me it is a configuration issue. If you can post the code for PLC1 &PLC2, we can look with a "fresh" eyes.
MVP 2023 Flex727 Posted March 4, 2013 Author MVP 2023 Report Posted March 4, 2013 Thanks! I'll go through the configuration carefully and if I don't find the issue I'll post.
Oliver Umanzor Posted September 11, 2016 Report Posted September 11, 2016 Hello! Did you found the issue? I apreciated your help!
MVP 2023 Flex727 Posted September 12, 2016 Author MVP 2023 Report Posted September 12, 2016 Yes, I just had a configuration issue (port numbers weren't addressed properly). These PLCs can definitely act as both a Master and a Slave simultaneously. 1
HigHTech Posted September 12, 2016 Report Posted September 12, 2016 1 hour ago, Flex727 said: Yes, I just had a configuration issue (port numbers weren't addressed properly). These PLCs can definitely act as both a Master and a Slave simultaneously. Nice, I have a pretty good number of applications running that way. My only recommendation is trying to use an Unistream as Master. The communication is much better and so easy to do it. Good luck
juanpancho88 Posted October 26, 2017 Report Posted October 26, 2017 Hi, I'm trying to do almost same thing, but only one PLC (Vision 1210). It is Master when comunicating with a rpm driver trough serial. And it is Slave when I try to communicate from software in my laptop trough ethernet (software creates a master instance). PLC works perfect when controlling rpm driver. From laptop to PLC the connection is established (I open a tcp/ip connection using IP and port 502 of PLC and it says "OK" without errors), but when try of read holding registers nothing happens. I know there are two sources of error: 1) software is not asking properly for the registers. 2) PLC setting are wrong. I ask you to give a look in my PLC configuration and tell me if you see any problem. Thank you in advance. Juan Extra info: PLC Vision 1210, software is LabView. Visilogic version 9.8.64. Win 7 32-bit
MVP 2023 Flex727 Posted October 26, 2017 Author MVP 2023 Report Posted October 26, 2017 You're piling too much stuff into one ladder rung. I've never tried to perform MODBUS Config before Socket Init, but it is likely important to perform the Socket Init first. Your ladder rung loses control over that order execution. Try breaking that rung into 3 or more separate rungs. I'll repeat something I've said before - Unitronics WILL NOT charge you by the rung. Break your code up into the basic simple instructions for both readability and to have more certainty that the code will compile the way you think it will. If that doesn't solve your problem, then you need to post the internal workings of each of your function blocks or post your .vlp file here.
juanpancho88 Posted November 8, 2017 Report Posted November 8, 2017 Thanks for your advice Flex727. I break code in simpler rungs and check every socket parameter and it works! I'm reading holding register from my software through TCP/IP Modbus. Best regards! Juan
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now