05-12-2013 10:34 AM
Hi All,
Please run attached try.vi, then just click Stop.
Why I can not stop it? I will appreciate it if can
figure it out for me.
Thanks,
guoguang
05-12-2013 11:13 AM - edited 05-12-2013 11:25 AM
Typical race condition.
What happens is as follows:
At the beginning of the iteration where the stop event executes, the STOP button has already been read as false. Since there is no data dependency, this happens in parallel to the first case structure. This means that when stop gets pressed, nothing gets enqueued and the dequeue operation will wait forever. The idle case can never be reached again.
I recommend you run your program with execution highlighting, operating the buttons while watching the diagram.
(There are several more things not very optimal with your VI.)
05-12-2013 12:15 PM
Hi Altenbach,
Thank you for your insightful comments.
Could you tell where is there something not very optimal?
Thanks a lot!
Guoguang
05-12-2013 12:38 PM
Without doing too much about your code, I've changed it so it works. There might be better ways, but this gives you a good impression on how it should work.
05-12-2013 03:13 PM
Thanks, elephant