LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read multiple samples from a shared variable

Hi All,
I have started using LV8.2 and would like to use shared variables to communicate and send data from my cFP unit to my host pc.
In my application, i am writting data to a network enabled shared variable at a rate of 200Hz, but would like to limit the reading of the shared variable to 20-50Hz on the host PC.
I was previously able to perform this operation  by writting to an RT FIFO on the cFP and sending data through TCP/IP, where I would read packets of data on my host PC as they came in, thus being able to keep up without overflowing the FIFO on the RT side. Now I am only aable to read a single sample at a time from the shared variable. So my question is, can i read packets of data on my host pc so that my FIFO doesnt overflow (similar to a Flush Queue function) or do I need to stick to TCP/IP?
 
Cheers,
David
0 Kudos
Message 1 of 3
(3,068 Views)
Hi David,
 
From what I understand, you were not using shared variables before and would like to start using them now.  If so, you just need to enable buffering on the shared variable in question.  You can look at Using the LabVIEW Shared Variable for more information on how to do that.
 
If you still have questions, we are always here to help.  Have a great day!
 
Janell Rodriguez | Applications Engineer | National Instruments
0 Kudos
Message 2 of 3
(3,050 Views)

Hi Janell,

I understand the concept of buffering data. However, from what i understand on the operation of shared variables, I will only be able to read a single point every read iteration on my host PC. If my RT app is writting data to the shared variable faster than what my host pc  is reading it (200Hz v 50Hz), then I will certainly fill my buffer and overwrite old data before i can read it.
What I would like to do is read ALL items in the shared variable buffer, not just one, every time I do a read of the shared variable on my host pc.

Thanks

David

 

0 Kudos
Message 3 of 3
(3,046 Views)