LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updting loop inputs

Solved!
Go to solution

You will always get the most recent value

 

Notifier.png

 

The result is 9. Code in LV7.1 attached

 

 

0 Kudos
Message 11 of 15
(926 Views)

Hummer1, is there any way you could post this example in LV 7.1 format?

 

Thanks so much

 

 Leo

0 Kudos
Message 12 of 15
(913 Views)
Solution
Accepted by topic author leonardolt

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

Message Edited by Hummer1 on 12-01-2009 09:34 AM
Download All
0 Kudos
Message 13 of 15
(906 Views)

 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

0 Kudos
Message 14 of 15
(893 Views)

I like your idea of flushing the queue when you read....that's better.

 

Glad to help.

 

Hummer1

0 Kudos
Message 15 of 15
(886 Views)