LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a VI to communicate with a VI on another computer?

As a final project for a data acquisition I am developing a small meteorological station on one computer and getting it to communicate with another VI on a different computer, and I am lost as to how I go about doing that. I know about using shared variables to communicate across VI's, but I do not know how to use them to communicate across computers over a WiFi connection. 

Any help/advice would be much appreciated.

0 Kudos
Message 1 of 5
(3,206 Views)

I like to use the Network Streams, because the communication loss/recovery is kind of automatic. If you use simple TCP/IP VIs, you have to implement those features yourself.

Here is a description: http://www.ni.com/white-paper/12267/en/

Message 2 of 5
(3,203 Views)

I second the Network Streams.  My second choice would be using the STM library, which is a library built on top of the TCP/IP API.  I despise Network Published Shared Variables (nothing but problems for me).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 5
(3,183 Views)

As a further comment on Network Streams - although they will auto-recover, they need to be terminated and restarted if you intentionally close one end.

For example, if you have a "server" (perhaps the meteorology station) and a "client", and your client connects to the server to read some data, then disconnects, you cannot restart the VI on the client and reconnect to the same connection - the server must terminate the stream and start a new one, then wait for connection.


GCentral
0 Kudos
Message 4 of 5
(3,130 Views)

@cbutcher wrote:

As a further comment on Network Streams - although they will auto-recover, they need to be terminated and restarted if you intentionally close one end.


And to continue on with that thought...

This is also why it is a good idea to have a "watchdog".  The idea there is that you send a NOOP command back and forth every so often.  So if you get a timeout, that means the other side likely disconnected or got lost in its own processes.  Therefore, you close the connection when you get a timeout error.  Yes, you should also close the connection if you get an error saying the other side disconnected.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(3,107 Views)