LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using TCP/IP transfer data to another computer

I have a DAQ device that is acquiring data from 100 channels at 10 Hz in a while loop. Now, part of the data is used on the local computer, part of them needs to be send to another computer. I'm trying to use TCP/IP to do it.
 
The problem is, however, the client server may not be running all the time and I still need to the server program to run on the local computer. If I put my TCP open outside the while loop, then the loop won't execute until a connection is established. If I put it inside the loop, it will try to open the port every time the loop executes (10 Hz). Idealy, once the client program is running, connection established, the program should never try to re-connect until the client program is shut down. This seemingly simple requirement has turn out to be a headache for me. Any good ideas?
 
pellet
0 Kudos
Message 1 of 4
(2,919 Views)
Hi pellet,
you can use a client server arcitecture. Use the "create listener" and "wait for listener" function. Create the connection on your client side. Use the "tcp read" function with a timeout of "-1". Send your data if you want and the other side will receive it. To get some good examples use the example finder and search for TCP/IP. If you have futher questions, don´t hesitate to ask.

Mike
Message 2 of 4
(2,914 Views)
Thank you MikeS81.
  I am able to follow your lead and write a program that does what I wanted. Your help is mostly appreciated.
0 Kudos
Message 3 of 4
(2,888 Views)
Another approach is to use VI Server (which is built on top of TCP). Create a functional global that the server writes data to. On the client end use VI Server to remotely run the same functional global in "read" mode to get the last data written to it.

Tastes great AND is less filling...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 4
(2,849 Views)