LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network-published variable - read buffer without emptying

Hello all!

 

Let me explain you my "problem". I have an RT target which collects data with a 1 sec resolution and stores them in a network-published variable (lets call this variable DATA). Another VI on my PC is reading variable DATA and is doing some basic analyses. However, this VI on my PC will not run continuously, but only sometimes.

 

The problem is that once I start the VI on PC, it reads a whole DATA buffer, and empties the buffer. How can I make that data from RT is stored in a network-published variable with buffer, and once the buffer is full oldest data samples are kicked out, and new data samples are put at the end (something like sweep waveform chart). In this whole process, I don't want to PC VI empty the buffer while reading it.

 

In other words, I want to have 86400 last data samples (corresponds to a single day) available at all time.

 

Please help 🙂

 

Best regards,

Marko.

0 Kudos
Message 1 of 3
(2,547 Views)

In addition to the previous message - I use data logging as a "buffer" of historical data, so now I actual want to empty the buffer once I read it Smiley Very Happy

 

However, another problem occurred - my data is organised as a 1D array with 44 elements in it, and I want to be able to access last 600 1D arrays (corresponds to 600 seconds of measurements of various variables). In order to enable this, I created a network-published variable with enabled network buffering, where buffering is configured with following parameters:

- Number of arrays: 600

- Number of elements (type: Array of Double): 44

Although I specified that I want to "remember" last 600 arrays, I somehow get only last 9 arrays. I tried to increase number of arrays to 1200, without any success - I'm still able to acess only last 9 arrays. Any suggestions?

 

EDIT: I figured out now that network-published variable buffer is starting to fill only when I start the VI that reads that particular buffer. Is there a way where buffer is filled always, regardless of the VI that reads it, so that once I run VI on PC buffer already contains last 600 arrays?

 

Marko.

0 Kudos
Message 2 of 3
(2,521 Views)

I would use a lossy queue on the RT machine to hold your last X samples.  You can then have a loop waiting for a TCP connection (with you Windows PC) and then wait for requests for the data.  Using a Network Stream would likely be the best way to send the data to your PC.



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 3 of 3
(2,495 Views)