LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I implement client-server functionality in LabVIEW most efficiently?

Dear Discussion Forum,

I am implementing a DAQ-monitoring/control application in LabVIEW and need a hint on which would be the best way to implement the communication between the Graphical User Interface VI (which is intended to run on any remote PC), and the Data Acquisistion/Control Loop VI (running on a PC in the lab).
As these processes will run in parallell, and on separate network PCs, I need a way to establish the communication between them.

My first idea was to use the VI Server functionality(?), i.e. let the GUI VI set and/or get control/indicator values on the DAQ VI's frontpanel using a VI refnum and the Invoke Node. However, it was difficult to implement the conveniant communic
ation procedure "Send command - Get result" reliably this way.

So I thought of using the TCP technology, and to implement the DAQ VI as a server, and the GUI VI as a client. As I however need to transfer many different datatypes, it would be nice not having to do the extra work involved in flattening/unflattening data during transfer... my question is thus:

Q) Would it be better to use DataSocket technology instead of TCP?

Regarding DataSocket, I have a few questions (as this feature is new to me):

1) To do 2-way communication, do I necessarily need two URLs/lines (dstp:\\localhost\line, not sure about the terminology here)?
2) Do I need different URLs for different datatypes, or can many datatypes be sent over a single URL? (variant datatype...?)
3) When reading a value from a URL using DS Read.vi, I need to know that it is not an old value. I have tried the Wait For Updated Value together with a non-zero Timeout time, but it seems to work dubiously, the DS Read.vi retur
ning sometimes(!) immediately with a value, although nothing has been written to the URL.
4) Is data that is written to a URL buffered/qeued?

Need to be clear on these points if I will use DS instead of TCP.

Grateful for hints!

/m. eklund
0 Kudos
Message 1 of 2
(2,767 Views)
In my experience, Datasocket is definitely the way to go here, as the data actually transferred over the network is minimal, hence very fast. Be sure you install the DataSocket Manager, which will allow you to easily select the data types you need. The URLs will be the same, but the actual data will be in a subdirectory. Look at the examples in the help files.

I think you'll find Datasocket works as well or better than expected. It's one of my favorite features of Labview.

Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 2 of 2
(2,767 Views)