12-04-2015 04:46 AM
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
Solved! Go to Solution.
12-04-2015 04:52 AM - edited 12-04-2015 04:52 AM
12-04-2015 04:59 AM - edited 12-04-2015 05:04 AM
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
12-04-2015 06:44 AM
12-04-2015 06:55 AM
@GerdW wrote:
Hi Slevin,
when using lossy queues with the "Lossy enqueue" function your producer loop will not wait!
That is good to know!