Hello application engineers,
I am encountering a boring bug and played around to find a solution, unfortunately, No success.
Enqueue and dequeue are used in my program (similar to the attached one, XY_B.vi). The program worked fine without the release queues, however, after adding the release queue to the end of the program, a boring bug appeared . It always shows the last data point goes back to the zero time when the program stop is clicked as shown in the attached photo (Program stop.png). but the bug does not show if the labview stop button is clicked to stop the program (Labview stop.png).
Could someone help with the issue?
Solved! Go to Solution.
You're killing the queues after the bottom loop finishes, but not waiting on the top loop. The bottom loop finishes first, so your top loop runs one more time, gets errors on both dead queue references, and adds a point at the default location (0,0).
You can either add a dataflow dependency to the queue releases so that it happens after the top loop is done, or you can add a case statement so that the 2x "Build array" nodes on the top don't run when they get an error on the wire.
On further checking, I see that since you're only enqueueing data half the time but enqueueing the Stop queue every time, you're getting a whole lot of extra Stop signals built up. You need to enqueue an even amount into the queues, or use a different form of messaging (Tag channel wire or notifier, probably) for the Stop signal.
Thank you for your suggestion. I moved the release queues from the end of enqueue loop to the end of dequeue loop, the bug is gone.