LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel loop data exchange

Solved!
Go to solution

Hey guys,

 

I have a simple question and I hope yo ucan help me with an elegant solution.

 

I have 2 parallel while loops acquiring data @ 2Hz and 0.83Hz. Now I want to save the most recent value of both loops in a third loop.

What is the most elegant way to do this?

As I already implemented queues for data transfer, maybe you can include them in the solution 🙂 but it is not necessary. The problem with the queues is the point with the most recent data :)

 

kind regards

 

Slev1n

0 Kudos
Message 1 of 5
(2,874 Views)
Solution
Accepted by topic author Slev1n

Hi Slevin,

 

use notifiers!

Or lossy queues with a length of 1…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(2,872 Views)

Thanks for the fast answer,

 

one question regarding the "lossy queues". If I understand the help correctly, than using a queue with length one would cause the "queue write" function to wait until the place is free again. But as writing is faster my timed loop will fail to execute in the right time due to waiting for the "save loop" to read from the queue.

 

Does notifiers dont have this problem? EDIT: Ok, they behave different 🙂 I just read this here:

"Unlike the Queue Operations functions, the Notifier Operations functions do not buffer sent messages. If no nodes are waiting on a message when it is sent, the data is lost if another message is sent. Notifiers behave like single-element, bounded, lossy queues."

 

kind regards

 

Slev1n

0 Kudos
Message 3 of 5
(2,866 Views)

Hi Slevin,

 

when using lossy queues with the "Lossy enqueue" function your producer loop will not wait!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,842 Views)

@GerdW wrote:

Hi Slevin,

 

when using lossy queues with the "Lossy enqueue" function your producer loop will not wait!


That is good to know!

0 Kudos
Message 5 of 5
(2,838 Views)