LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to: distribution data on my network

Hey guys and girls, just after some pseudo-style help here...
 
I have a computer that is connected to a piece of hardware that I'm collecting data from and that I want to share that data with other computers on my network. This data is real-time and inbound at about 480kbps.
 
I want an unknown number of clients to be able to connect to my main (server) VI and be able to see this data but I'm unsure of the best method of distributing the data.
 
 
I know I will use TCP/IP to transmit my data and I already have a VI that allows me to send and receive data between two networked PCs. My problem is I don't understand the best way to deliver the data to more than 1 person.
 
Would I have to send each client all of the data individually, creating a queue of clients to send to? Or would it be better to have clients just "read" the data from the server application? If so how could labview do this? Would I hold the data in a table? Local/Global vars? On disk in a file? I want to avoid race conditions and also am wary of processor loading.
 
For example let's say my data is 10 binary words and I receive "new" data at 25Hz.
 
Should I send each client all of the data once they are connected? If so can anyone suggest a pseudo-method for doing so?
 
Or would I be better off having a client request the specifc word's (data) it is interested in and then just send that (reducing network loading etc.)
 
 
The most important thing is being able to distribute the data in real-time to everyone - and I can't use UDP, only TCP/IP if possible,
 
 
 
What's the best method for me to attack his problem? Any help greatly appreciated!
 
Thanks Smiley Happy
0 Kudos
Message 1 of 3
(2,174 Views)
If you only want to publish an updating piece of data and have each client aware of only the more recent value, using shared variables (in 8.x) or Datasocket (before 8.0) is the easiest way to go. It uses TCP/IP under the hood and requires almost no configuration.
 
If you want each client to have access to all the data and to be able to send updates to each client when they arrive, you will need to implement a protocol. Essentially, each message will have a part at the beginning which will say what the message type is. That way, when a client connects, it can ask for all the data and later then it can ask just for new data. If you want to see an example, search this site for "messaging protocol".
 
There are several ways for handling multiple connections and I believe there is at least one example in the example finder. If you have more issues after this, post more details.

___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,157 Views)
Sounds like a case for an OPC server program. All of the other pc's would run an OPC client application to read data from the server.
0 Kudos
Message 3 of 3
(2,139 Views)