Nir Posted September 23, 2012 Report Share Posted September 23, 2012 Hi All I need some help to write a software and use MODBUS TCP/IP between Vision 130 as a Master and two V130 as a Slave how to configure the ports in Master V130 PLC (I'll Would love to have a configuration VLP file). thanks, Nir Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted September 24, 2012 MVP 2023 Report Share Posted September 24, 2012 Look under Help->Examples->Version 900->Project Examples->Communications->Ethernet->Ethernet MODBUS IP The example is for a V280 but it works the same for a V130. Also look in the Modbus Slave Addressing Help for how the address tables work in an enhanced PLC. Joe T. Link to comment Share on other sites More sharing options...
Nir Posted September 24, 2012 Author Report Share Posted September 24, 2012 Hi Joe I looked at the example, the configuration of one controller and one Master everything works, with two Slave I can't communicate at the same time. I'll opening another socket but I got Error 5 always. Please, send me a Small procedure how to configurat the sockets. my IP is: Master: 192.168.127.10 Slave 1: 192.168.127.253 Slave 2: 192.168.127.254 thanks, Nir Link to comment Share on other sites More sharing options...
Damian Posted September 24, 2012 Report Share Posted September 24, 2012 Post your code and we can help fix it. What is your gateway set to? Link to comment Share on other sites More sharing options...
Nir Posted September 25, 2012 Author Report Share Posted September 25, 2012 Hi I found the problem in my aplication, I had to put another box of Modbus configuration for the other socket. But from what I understand there are limited number of concurrent controls parallel.....only 4 slaves. Thank you all, Nir Link to comment Share on other sites More sharing options...
Damian Posted September 26, 2012 Report Share Posted September 26, 2012 Hi I found the problem in my aplication, I had to put another box of Modbus configuration for the other socket. But from what I understand there are limited number of concurrent controls parallel.....only 4 slaves. Thank you all, Nir Only 4 active connections socket connections. That is correct. Link to comment Share on other sites More sharing options...
Gabriel Franco Posted September 26, 2012 Report Share Posted September 26, 2012 Only 4 active connections socket connections. That is correct. But doesn´t mean only 4 slaves can communicate with a master, does it ? Is it possible using a single socket communicate with multiple slaves ? Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted September 27, 2012 MVP 2023 Report Share Posted September 27, 2012 You can absolutely use a single socket for many slaves. In the Modbus IP Config block you define the IP address and ID of each slave. In your Modbus read or write block you then use an MI instead of a constant to pick the index of the slave you want to communicate with. Or you can have multiple Modbus read/write blocks; just make sure you only call one at a time and check the overall Modbus IP status bit (defined in the Config block) to verify that it's not busy doing something else. Nir is setting his up to have simulataneous conversations. You need a separate socket for each if you want to do that. You'll have to look at your application and decide what kind of response speed you need and determine if the "slower" response time of multiplexing a single socket is acceptable. Joe T. Link to comment Share on other sites More sharing options...
External Moderators tmoulder Posted September 27, 2012 External Moderators Report Share Posted September 27, 2012 Hi Joe, I've always done it with 1 socket per device, so I'm curious - in the method you describe, do you need to TCP Connect / Close to each device prior to communicating with it? TM Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted September 28, 2012 MVP 2023 Report Share Posted September 28, 2012 TIm- Yeah, I forgot to mention the Connect/Close requirement. Which I should have remembered, because the first time I played with Modbus IP I didn't realize that the Connect is required and I treated it like regular Modbus. It drove me nuts untill I looked at the V280 Modbus IP Master example. I mentioned in another post that the Modbus IP Help needs to be updated to include this "minor" requirement. Joe T. Link to comment Share on other sites More sharing options...
Damian Posted September 28, 2012 Report Share Posted September 28, 2012 Just to put some numbers to this to give the OP a sense of timing. Using a V570 (fastest CPU) and dedicating connections to a single slave each, I can perform a full read and write cycle to 4 slaves in on average 15ms. That is, I can read and write to all four slaves in under 12.5 to 20ms. It peaks out at 20ms and occasionally I might get one 22.5ms cycle hear or there. Not deterministic of course. Now as an example, and I decide to multiplex one socket and talk to all four slaves that way you will find that it takes about 100ms to establish the connection. And this is for each slave. Once you are connected you will want to do a read and a write before opening the socket again. Between that and the socket close that adds about another 15ms of overhead. So all together you will end up around 450ms for a read write cycle to all slaves by multiplexing. So multiplexing in this example is slower by a factor of about 20 times! So, be careful doing it that way. Most of my processess cannot handle that degree of latency. They have developed FAST socket Open/Close FBs that are much faster, but they have not officially released them yet. It is also possible to create a socket pinwheel, although the code gets quite complex. The theory behind it is you use three sockets or so. While you are talking to slave 1 with Socket 1, you start connecting to Slave 2 with Socket 2, then maybe slave 3 with socket 3, once Slave 1 is finished Socket 1 closes with Slave 1 and then connects with Slave 4 while you're still reading from Slave 2 on the other socket. Then Socket 2 closes and connects to slave 5. Etc. You get the picture. It helps mitigate the time wasted establishing the connection. 1 Link to comment Share on other sites More sharing options...
Armando Posted January 5, 2018 Report Share Posted January 5, 2018 Please. I have the same problem. I can't conect with multiples slaves. Here is my code. It's v1040 with logos. PRUEBA COMUNICACIÓN.vlp Link to comment Share on other sites More sharing options...
Armando Posted March 16, 2018 Report Share Posted March 16, 2018 The only way is multiplexing the slaves because there is one socket for modbus tcp/ip protocol. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted March 16, 2018 MVP 2023 Report Share Posted March 16, 2018 40 minutes ago, Armando said: The only way is multiplexing the slaves because there is one socket for modbus tcp/ip protocol. You have 4 sockets available and you can initialize them to any of the available protocols. Simply initialize two of them to TCP Master, set up the port numbers correctly to match the slaves, and configure MODBUS for each. Be sure to check out the example projects for the recommended method to connect and transfer data and you should be good to go. You only need to multiplex if you require more than 4 Ethernet connections. Link to comment Share on other sites More sharing options...
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