_PH Posted June 8, 2022 Report Share Posted June 8, 2022 Hello Have inherited a SM43-J-R20 unit that is supposed to be acting as a Modbus Slave to a SCADA system. Currently am having issues getting it to talk to the host. From what I have gleaned from the forums/tutorials, it seems to be setup correct but obviously isn't as it is not talking. Any help would be appreciated. 20220608_1620.vlp Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted June 8, 2022 MVP 2022 Report Share Posted June 8, 2022 Your modbus slave code is placed in one rung. SB2 R and S coil is not correct. Please use Visilogic Example file V570_TCP_slave.vlp from Communication/Ethernet folder - it is only two rung needed for run TCP Slave. Quote Link to comment Share on other sites More sharing options...
_PH Posted June 9, 2022 Author Report Share Posted June 9, 2022 kratmel Thanks. That setup does look cleaner/simpler. I am not understanding IP/ID relationship though. Could you shed some light on that? This controller is the slave, so I am not sure why we need to set up slave in the Modbus IP Config block. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted June 9, 2022 MVP 2022 Report Share Posted June 9, 2022 That section of the configuration is only applicable if the PLC is the Master. It defines the Slaves the Master will be communicating with. Since your PLC is a slave, you can ignore it. Quote Link to comment Share on other sites More sharing options...
_PH Posted June 9, 2022 Author Report Share Posted June 9, 2022 Ok, perfect. Thank you. Quote Link to comment Share on other sites More sharing options...
_PH Posted June 9, 2022 Author Report Share Posted June 9, 2022 So now with those changes, I can see the controller on the network but am not able to pull values from it via Modbus. I am direct connected to it, with no firewall issues. Am using MDBus to test the setup. Any ideas what I am doing wrong? 20220609_0700.vlp Quote Link to comment Share on other sites More sharing options...
_PH Posted June 9, 2022 Author Report Share Posted June 9, 2022 I am also getting confused with how the IP addressing is supposed to be setup. Is the controller IP address set in the TCP/IP Project Settings or in the TCP/IP Card Init? This controller is connected to a cell modem, so it would technically be the Master on the local network I believe. Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted June 9, 2022 MVP 2022 Report Share Posted June 9, 2022 Please read in Visilogic Help about Sockets and Visilogic Ethernet connection. In Samba present 4 Sockets, inV700 8 on board. Quote Link to comment Share on other sites More sharing options...
_PH Posted June 9, 2022 Author Report Share Posted June 9, 2022 I have been through the help and tutorials a few times now. Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted June 9, 2022 MVP 2022 Report Share Posted June 9, 2022 Maybe useful topics Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted June 10, 2022 MVP 2022 Report Share Posted June 10, 2022 18 hours ago, _PH said: I am also getting confused with how the IP addressing is supposed to be setup. Is the controller IP address set in the TCP/IP Project Settings or in the TCP/IP Card Init? The PLC IP address is set up in the TCP/IP Card Init Function Block in ladder. The TCP/IP Project settings are set to allow VisiLogic to communicate with the PLC via Ethernet. The fields in the Project settings should match the configuration in the PLC ladder in order to communicate successfully. 19 hours ago, _PH said: I can see the controller on the network but am not able to pull values from it via Modbus From above, I see the PLC address as 192.168.0.1 and I see the MDBus set to 192.168.0.10. It looks like a typo in the TCP/IP Card Init FB, as you seem to have the PLC address and the Default Gateway set to the same address, which is unusual. Quote Link to comment Share on other sites More sharing options...
_PH Posted June 10, 2022 Author Report Share Posted June 10, 2022 Sorted out the IP address settings and following one of the posts supplied have rolled back my OS. Now am running 9.8.65 software and 4.004(31) OS. I can get MDBus to latch onto the controller and see Modbus values after I complete a download but cannot reconnect after closing the MDBus session. Are there any tricks for triggering a CLOSE of the TCP/IP socket/connection? I have been going through the help file to figure a way out to trigger the CLOSE:TCP function but not coming up with anything viable. Link to forum post: 20220610_9-8-65.vlp Quote Link to comment Share on other sites More sharing options...
_PH Posted June 10, 2022 Author Report Share Posted June 10, 2022 Think I have the reconnect sorted out. After setting the socket keep alive to 10, am now able to reconnect an ended session. Now just need to sort out the proper Modbus address for MF-0. Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted June 10, 2022 MVP 2022 Report Share Posted June 10, 2022 Good job. However, as always, I ask the author of the topic to briefly tell us about the journey. That is, which version of the firmware did not work and which solved the problem. This is important for future forum participants who will follow this path. Quote Link to comment Share on other sites More sharing options...
_PH Posted June 10, 2022 Author Report Share Posted June 10, 2022 To get Modbus TCP/IP comms established, I downgraded to Visilogic version 9.8.65 with OS 4.004(31). I could not get 9.8.95 with OS 4.10(48) to work. To get the TCP connection to close on inactivity, setting SI-105 (Socket 2 TCP/IP Keep Alive) to 10, seem to be the fix. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.