LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from and writing to shared variables dynamically

I have a program that reads a configuration file to know how many channels to collect and publish to display clients.  Currently( LV7.1) I use a .scf file to determine the channels to acquire and process to tags.  I can then read my tags on the display applications.  I have been playing with the shared variables and can read all my data based on the configuration file but my question is what is the best way to publish this data?  From what I have seen, the only way to publish an indeterminate number of channels is to use a datasocket write in a for loop with my channel name and data as the controlling factors for how many times the loop runs. 
0 Kudos
Message 1 of 3
(2,302 Views)
AJL,
 
The best way to do this is to use the datasocket vi's.  If you have a lot of shared variables, typically it's best to have a loop which opens all of the datasocket connections, then a loop which reads/writes to the variables and then a loop in the end which closes all of the connections.
 
I hope this helps,
Justin D.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,287 Views)
Thanks Justin,  That is what I was thinking.  It just seems taxing to run a loop 300+ times to publish data to display clients.  I plan on only writing to the shared variables that have a value change but in my current situation the data is fairly dynamic so all my variables will most likely be updated every time (10 Hz).
 
Thanks again.
 
AJL
0 Kudos
Message 3 of 3
(2,259 Views)