06-14-2017 12:35 AM
Good morning everyone,
it seems to be that i have a real problem to understand queues and notifiers.
adding a timeout to first dequeue helped that the consumer loop was running. but my states are switching.
So i tested in simple version with notifier. And it had the same effect. attached is the vi (2014)
My understanding is following.
If i´m sending a message or enum queue to the case, the structure is switching. Then the buffer is clear and no input is on the case selector. Now it´s going back to default.
According to my simplest example with notifiers, how is it possible to hold states?
06-14-2017 01:07 AM
Problem with band-aids -> they lead to more band aids. This one is easy to fix, but it's just another band-aid.
The solution is to fix the architecture. Actually, in the example you put up here, you wouldn't have a problem with no timeout, which is the intended way to use Producer-Consumer.
In the 'fixed' VI I attach, I check for timeout.
06-14-2017 08:14 AM - edited 06-14-2017 08:14 AM
Assuming I am understanding your problem, what I typically do is hold the timeout in a shift register. So when a message is received to start acquiring data, the timeout is set to 50 (per your example). With a string data type, an empty string will be returned from the Dequeue Element if there was a timeout. So in the "" (empty string) case, you perform the read. When commanded to stop, set the timeout to -1 (wait forever).

06-26-2017 04:10 AM
Hello everyone,
i´m sorry for the late reply.
Thanks to all for the answers and Solutions. I will try and learn more. For first t seems to be good.
So i can think about my generally program structure.