Jump to content

Recommended Posts

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

Link to comment
Share on other sites

  • MVP 2021

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.

Link to comment
Share on other sites

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.

image.png

Link to comment
Share on other sites

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?image.thumb.png.ecb242b7031d9685f28ca7ac16989527.png

20220609_0700.vlp

Link to comment
Share on other sites

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.

image.png.1a0952e3171fc26aad1526abc9de0a09.png

image.png.43796e5ec109754122611a0a1baa4b39.png

Link to comment
Share on other sites

  • MVP 2021
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.

Link to comment
Share on other sites

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.

image.png.d54e8c17e4e047a5da32c141ebcc8d17.png

Link to forum post:

 

 

20220610_9-8-65.vlp

Link to comment
Share on other sites

Think I have the reconnect sorted out. After setting the socket keep alive to 10, am now able to reconnect an ended session.

image.png.63bf13025bdcb17b0fee6c1bf163a11c.png

 

Now just need to sort out the proper Modbus address for MF-0.

Link to comment
Share on other sites

  • MVP 2021

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.

Link to comment
Share on other sites

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.

  • Thanks 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...