LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't Stop

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

0 Kudos
Message 1 of 5
(2,394 Views)

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.)

Message 2 of 5
(2,389 Views)

Hi Altenbach,

 

Thank you for your insightful comments.

Could you tell where is there something not very optimal?

 

Thanks a lot!

 

Guoguang

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

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.

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
Message 4 of 5
(2,360 Views)

Thanks, elephant

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