Author Topic: Nano Client over few servers  (Read 31041 times)

acxysty

  • Newbie
  • Posts: 35
  • I'm a llama!
    • View Profile
Nano Client over few servers
« on: May 07, 2014, 12:26:30 AM »
Dear all

We are using Nano as client Modbus/TCP and we would like to communicate with several servers without opening and closing the sockets.
Is there a way to do that ?
Regards
TY

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Nano Client over few servers
« Reply #1 on: May 07, 2014, 12:09:13 PM »
Since the Nano-10 only has one socket to act as client you do have to close any existing connection before you can open a connection to another server. However, the socket on the Nano-10 allow you to reuse the socket immediately after it has been closed on one server and use it to connect to another server. So there is not too much latency to switch from one server to another especially if it is over a local area network.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

acxysty

  • Newbie
  • Posts: 35
  • I'm a llama!
    • View Profile
Re:Nano Client over few servers
« Reply #2 on: May 08, 2014, 01:53:22 AM »
Thank you for your answer.  It works fine the way you describe and we use it a lot.

However we never get the Status(3) flag changing according to connect or non-connect.

Any idea why ?

Regards

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Nano Client over few servers
« Reply #3 on: May 08, 2014, 11:46:11 AM »
The STATUS(3) will return a 1 when a connection has been made. So if the network is busy or network latency is high it may take a little longer to return a 1. You should wait for  STATUS(3) to return a 1 before sending READMODBUS/WRITEMODBUS etc commands.

When you close a socket, there is a bit of house keeping that the network stack need to do to fully close the socket. Only when the socket is fully closed then STATUS(3) returns a zero.

If you do a round-robin connection to each slave quickly then managing the network connection and disconnection is important, otherwise you may encounter situation where the next connection will fail because the last connection is still open.

Attached sample program "ModbusTCPTest.PC6" file is a good example to follow to prevent your program from getting stuck in inability to close a previous connection properly before making a new connection.
 
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

acxysty

  • Newbie
  • Posts: 35
  • I'm a llama!
    • View Profile
Re:Nano Client over few servers
« Reply #4 on: May 14, 2014, 01:25:08 AM »
It works now.
Thank you
Regards

sebraun

  • Newbie
  • Posts: 4
  • Nothing so needs reforming as other peoples habits
    • View Profile
Re:Nano Client over few servers
« Reply #5 on: June 16, 2015, 08:09:53 AM »
I would like to resurrect this issue.  Using the Nano with Modbus TCP servers, specifically the ADAM 6051 and a Acromag analog input module: how quickly can the TCP connection be opened and closed?  I need to sample an analog input every second and I need another two digital modules on the network as well that are not time critical.  Currently, my testing with just the Acromag indicates that this is not going to happen.  How do I manage higher speeds on local but remote IO networks?  

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Nano Client over few servers
« Reply #6 on: June 16, 2015, 09:04:39 AM »
We have previously did a round-robbin test of a network of several PLCs where a Nano-10  open a connection, send a command and receive data, close the connection and move on to the next Modbus/TCP server within a fraction of a second. We did not specifically measure the time it takes but I believe it is possible to complete a cycle of five network controllers within less than 1 second.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

sebraun

  • Newbie
  • Posts: 4
  • Nothing so needs reforming as other peoples habits
    • View Profile
Re:Nano Client over few servers
« Reply #7 on: June 16, 2015, 09:07:37 AM »
OK...I'll setup today and give it a go.  

Tnx....S