12/4/2014 8:50 AM | |
Posts: 20 Rating: (0) |
Hi! I'm going to implement Modbus TCP communication in my current project. I'm using one S7-1500 as a slave, and a central PC as master. This PC has a custom software, probably visual basic, and it communicates with all the other Siemens PLC via Modbus TCP. Let's see if I understood this: I have to make, at least, two MB_CLIENT instances, one to write values, and other to read values, right? The PC software will read values from the PLC and, if the user needs it, write or changes some of the values in the PLC. I can do this with these blocks right? Your help will be very much appreciated, thank you!
----------- new subject after splitting from Sample Program: Modbus TCP with S7-1500 |
Last edited by: CS Moderator at: 12/4/2014 11:41 AMsplitting |
|
12/8/2014 11:27 AM | |
Posts: 40 Rating: (0) |
Hello, Yes ,you can use two blocks in MB_CLIENT for Read and Write .You have to change the connection ID for the second one.i.e both blocks should have different connection ID .here i am attaching a sample program which i did for testing in (TIA v11 sp2).In this program i used 1212c DC/DC/DC cpu. Regards Prasanna Gk If u found this post helpful ,please rate this post.
AttachmentModbus tcp PLC asCLIENT.zip (1963 Downloads) |
Last edited by: Gkp Raina at: 12/9/2014 11:55 AM |
|
This contribution was helpful to1 thankful Users |
12/9/2014 12:03 PM | |
Posts: 40 Rating: (0) |
Hello , If you want to keep your plc as slave (server) ,you have to use MB_SERVER block.In server ,you Will have only one connection ID ,you can connect as many as 8 clients (varies on CPU and Firmware versions) to that server.I did a sample code and am attaching that that here. Regards prasanna GK If u find this post helpful,please rate this post
AttachmentModbus tcp PLC as SERVER.zip (1522 Downloads) |
Last edited by: Gkp Raina at: 12/9/2014 12:20 PM |
|
This contribution was helpful to2 thankful Users |
Follow us on