Jump to content

Modbus TCP Socket doesn't close, when I turn "Off" the Active Periodic bit.


tim.snelling

Recommended Posts

Hi,

I need to have several UniStream PLC's (Modbus Master TCP), that connect to a Modbus TCP Slave. The Slave provides Ambient Temperature, so reading the Holding Register from the Modbus TCP slave every 30 minutes or so, is adequate.

In UniLogic ladder logic, I set the Active Periodic bit "On" with a 30 minute timer, then it reads the holding register. After a successful update, I then turn "Off" the Active Periodic bit, but the PLC's socket connection does not close, and the Status of my Modbus Master remains at "1 = Good, No Errors" for the entire time in-between the 30 minute read from the Modbus Slave.

Can someone tell me how to close the Modbus TCP socket connection on port 502, using the UniLogic ladder logic.

Thanks, Tim S.

 

Link to comment
Share on other sites

  • MVP 2023

I don't think the Modbus table ever actually closes its connection, as you are observing.  I rooted through all the system bits and didn't see anything useful.

You may have to resort to doing your Modbus communications the hard way as in how it's done in Vision.  I've gone to using the Advanced Modbus Functions for my communications, as every aspect can be specified and multiple parallel sessions can be had.  See this post - 

 

 

Joe T.

Link to comment
Share on other sites

  • 2 weeks later...

Joe T., 

Thank you for the pointer. I had to move on to other projects, and I'm going to be getting back to this project soon. It appears that the Advanced Modbus Functions will give me what I need.

Gabriel,

Your idea could work, however these PLC's will go into many sites, with a different number of PLC's, and possibly a different range of IP's, so setup would be more difficult. But if I can't get the socket to close using the Advanced Modbus Functions, then I may be forced to do something like you suggested.

Thanks guys,

Tim S.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.