11-30-2009 02:54 PM
You will always get the most recent value
The result is 9. Code in LV7.1 attached
12-01-2009 04:14 AM
Hummer1, is there any way you could post this example in LV 7.1 format?
Thanks so much
Leo
12-01-2009 09:31 AM - edited 12-01-2009 09:34 AM
Here is an image of the block diagram.
The operation goes something like this.
Establish a 1 element queue for whatever kind of data you are getting from Data Acquisition. In the data acq loop, take a new set of data whenever you need to. Flush the queue (get rid of the old data), and enqueue the new data.
In the calculate event structure ... Dequeue the data...(which will be the last one put on the queue) . The danger is that you will try to read the queue twice before the data acq runs again...but if data acq is running much faster than calculate, you are "probably" ok...
The front panel shows the controls.
Hope that helps...I'm sure the group can come up with better versions of this...
Hummer1
12-01-2009 11:17 AM
Dear friends, I'm witing to tell you that finally I solved the problem. I tried some arrangements with notifications, but none of them worked as expectd.
Hummer, thank you verry much for the examples but I could not open them. Although, the way I found to get the last value uses queues. I enqueue the values as they come in a LIFO architecture. Thus, after reading the most recent value, I flush the queue to free some memory. I was trying to avoid using queues, but it was the best way I found.
Thanks to everybody
Leo
12-01-2009 12:23 PM
I like your idea of flushing the queue when you read....that's better.
Glad to help.
Hummer1