From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP/IP CLIENT ALWAYS RUNNING, HOW?

Hi, i would like to know, if its possible to make a tcp / ip comunication but the client always running, i have two programs, one called "master" and other called "track point", master is a client and track point is the server, but server is going to be in a PC which at the end of the day is going to be turned off but master is always working, i want that at the next day, when i turn on the PC that contains the server "track point" comunicates to the client.
server starts to send information and client start to reads information.

How can i do that?

Thanks in advance.

0 Kudos
Message 1 of 6
(2,173 Views)

Well, the obvious thing to do is reverse the roles.  Make "master" the server and "track point" the client.  If that's not possible for whatever reason, you can have your client, if it loses connection to the server, periodically check for a new server connection.

0 Kudos
Message 2 of 6
(2,131 Views)

yes, in actual fact im working on it, but as i dont have much experience using labview and this is the first time using tcp/ip i cant get it, i thought in a boolean to use as trigger and use a case structure to reverse server in client and vice versa

0 Kudos
Message 3 of 6
(2,125 Views)

@Danybond wrote:

... i thought in a boolean to use as trigger and use a case structure to reverse server in client and vice versa


I'm not sure I understand. For TCP/IP you wouldn't usually want a boolean to determine whether something is a client or server.  Roles shouldn't be dynamically changed like that.  A server's role is to wait for a client connection/request and perform some action accordingly.  A client makes a connection to a server and sends and/or receives data to/from that server.

0 Kudos
Message 4 of 6
(2,116 Views)

ok ok, i have understood, you have gave me more idea, thank you.

0 Kudos
Message 5 of 6
(2,111 Views)

In TCP speak the server is a listener who starts up a loop that waits on a socket for connection requests. The server/listener MUST have been started by someone in order to be ready for connection requests. TCP/IP has no method to turn around these roles. The server/listener must be up and running by the time a client tries to connect to it. So this means automatically that your master should be the listener. Anything else only complicates the issue a lot.

Rolf Kalbermatter
My Blog
Message 6 of 6
(2,061 Views)