Author Topic: F1616 Closing connection?  (Read 11706 times)

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
F1616 Closing connection?
« on: February 26, 2010, 03:17:28 AM »
I have asked this question before, and the answer I got was if I?m connecting to different IP address/PLC I should have to wait this long and this should not be an issue. I?m still having this issue I open and close sockets. I'm having the issue after I close an active connection, for some reason I have to wait 5 second to try to connect to another PLC. Any idea?

1-   Connect
2-   Issue Read Modbus Registers
3-   Close connection
4-   Wait 5 second
5-   Try to connect to another PLC

How can I minimize this dead time from 6 seconds to like 1 second, is this the nature of the PLC?

Thanks,
Ed
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
Re:F1616 Closing connection?
« Reply #1 on: February 27, 2010, 11:32:40 AM »
I meant ' I shouldn?t have to wait this long and it shouldn't be an issues.'

Anyway, the problem is that every time I connect and disconnect from a device, I have to wait 4 seconds before I can connect to another device with a different IP. Less then 4 seconds the connection fails with a code of 'ERR:05-Prev Conn.ON' which mean that the previous issued command of Print #4 </> did not close the connection.

Thanks
Ed
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:F1616 Closing connection?
« Reply #2 on: March 01, 2010, 09:28:59 AM »
We tested the opening/closing of TCP connection and get similar result. Once the connection is established however you can send query and get response very rapidly. But when you try to close a current connection and connect to another IP address there is a need to delay a few seconds before another connection can be established.

When you send the PRINT #4 "</>" command the PLC initiates a close connection procedure to the O/S and then the PLC program will continue to run without actually waiting for the connection to close. The O/S will negotiate for the closing of socket with the remote server in the background.  Only when the O/S is satisfied that the remote server has completed the closing protocol would it allow another connection since there is only a single client socket.

I believe the current O/S is probably a bit conservative and could have allowed a faster connection to another server. We would report this to the product development and find out how this could be improved in future or if a workaround can be found.

You may want to schedule the program such that once a connection is established with a remote server, you will do all the necessary data communication with that server before changing to another server.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

EDGAR

  • Jr. Member
  • Posts: 60
  • Automating concepts around the world!
    • View Profile
    • Kinemics
Re:F1616 Closing connection?
« Reply #3 on: March 01, 2010, 05:41:27 PM »
Yes, once the connection is established you can read/write with no problem. On my end the PLC needs to communicate with 2 boilers, each boiler has 3 separate PAC (Master, Gas, Oil) each has their own IP. This make a total of 6 PAC and a total of 30 sec delay cycle 5 sec on each controller.

When you reach out to the development team, perhaps they should mix it up with the server and client sockets, support 3 Modbus Slave and 2 Modbus Master.
Low cost Modbus OPC DA Server, supporting Modbus RTU, ASCII, and TCP. Download your demo today! Go to www.kinemics.com/modbus.