7/30/2018 4:02 PM | |
Joined: 2/20/2007 Last visit: 4/29/2021 Posts: 6 Rating:
|
Dear Expert, I am trying to setup communication with TIA PORTAL V13 Sp1 with the MB_CLIENT. I am making two calls, one with mode 0 (Read) and one with mode 1 (write). Read: Mode = 0, ID = 1, Connectiontype = 11, ActiveEstablished = true, remote port = 502 and local port = 502 Write: Mode = 1, ID = 2, Connectiontype = 11, ActiveEstablished = true, remote port = 502 and local port = 502 I also have tried to change the local and remote port to 503 (first on the read instruction and then also on the write instruction). The problem is that at the write instruction I am getting an error 80C4. In order to make sure that one call is not interferring with the other call I set REQ of the read instruction to false but no change (still error 80C4). I also tried to disconnect the connections with TDISCON and establish the connection again with no result. When I try to read and write with a modbus simulator reading and writing is no problem. When setting up communications again I can make it work with the write instruction but then I am having errors on the read instruction. So both at the same time (eventough the call is not active at the same time) seems not possible. What also puzzles me is that even when REQ is false the status is changing all the time and also the error output is going on and off. Suggestions will be much appreciated! ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 7/31/2018 9:55:37 AMNew subject after splitting |
|
7/31/2018 10:08 AM | |
Joined: 2/20/2007 Last visit: 4/29/2021 Posts: 6 Rating:
|
Hello Huggy_d1, Thank you for your help. I only have one remote device where I am communicating with. I also have just one connection created with TCON, in the meantime I removed the TCON instruction, the connection is buildup bij the MB_client itself. I changed the program by using just one ID (No. 1) as you suggested but no result. Please take a look at the attachments, there is not more in the plc then these networks. As you can see REQ is false at both MB_Client instructions however in NW2 it seems to be active (green border) and in network 3 it's not. Even tough REQ is false at the write instruction (network 3) there is an error and status 16#80A3. I hope you have another suggestion. Thanks for helping! Jan AttachmentMB_CLIENT.pdf (446 Downloads) |
7/31/2018 10:17 AM | |
Joined: 2/20/2007 Last visit: 4/29/2021 Posts: 6 Rating:
|
Hello Huggy_d1, Thank you for your help. I only have one remote device where I am communicating with. I also have just one connection created with TCON, in the meantime I removed the TCON instruction, the connection is buildup bij the MB_client itself. I changed the program by using just one ID (No. 1) as you suggested but no result. Please take a look at the attachments, there is not more in the plc then these networks. As you can see REQ is false at both MB_Client instructions however in NW2 it seems to be active (green border) and in network 3 it's not. Even tough REQ is false at the write instruction (network 3) there is an error and status 16#80A3. I hope you have another suggestion. Thanks for helping! Jan AttachmentMB_CLIENT.pdf (240 Downloads) |
7/31/2018 10:21 AM | |
Posts: 3093 Rating:
|
Hello JaZa, Regards, |
7/31/2018 2:24 PM | |
Joined: 12/28/2011 Last visit: 3/6/2025 Posts: 6 Rating:
|
Hi JaZa, I just struggled with the exact same thing. My S7-1500 is Modbus Client, and I need to read (FC03) and Write (FC16) holding registers to ONE Modbus Server/Slave. At first I did what you tried, using two MB_CLIENT blocks with different Connection ID's. I made it work by triggering REQ and DISCONNECT etc on and off, but I wasn't happy with the result. I kept thinking it has to be a better way. (I wanted to avoid CONNECTING and DISCONNECTING all the time to eliminate stress on the Modbus link). I found a nice solution here at the forum that works great! It is created by Siemens expert Mr. Denilson Pegaia. Link to the forum post here: Download his sample program called MODBUS.ZIP posted on 4/28/2018 3:38 PM. Link here: https://support.industry.siemens.com/tf/ww/en/postattachments/download/?attachmentId=101943 He created a toggle logic between reading and writing, using the same MB_CLIENT and same Connection ID. The trick was to use the EN input on the MB_CLIENT block. I suggest you download the sample program and see. You have to enable CPU clock memory bits, and then you can decide how often you want to poll for new data using the different bits. Good Luck! Edit: Just realized that you are using V13, so you will not be able to open the sample project. So I've attached a PDF showing OB1 and the Datablock you need. Hope it helps! BR, Ole-Jacob Sørensen AttachmentModbus_Client.pdf (341 Downloads) |
Last edited by: olejacosor at: 7/31/2018 2:35:34 PM |
|
This contribution was helpful to
2 thankful Users |
Follow us on