LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What the program problem lie in?(VI attached)

Hellow,I met a problem in using dialog,see the attached Vi,when i run the main VI(Dialogtest.vi),the dialog appear,but i can not stop it,and i can not go to the main VI,anyone can tell the problem of the program? thanks a lot!
Download All
0 Kudos
Message 1 of 4
(2,767 Views)
Hi,

As I am able to see in your main vi, you have put sub vi in the while loop. In this case, each time while loops iterates, it will call the sub vi so sub vi's front panel will be continuously invoked & won't allow the user to perform any operation from the front panel.

So define when u want to call sub vi, put a case/event in main vi to invoke the sub vi. Put while loop in your sub vi so that it continuously runs till then u dont stop by it by pressing a button on sub vi.

Hope it helps. Your feedbacks are welcome.

Best Regards,
Nirmal
0 Kudos
Message 2 of 4
(2,767 Views)
Hi!
could you please give me an VI to show your idea? thanks a lot!
0 Kudos
Message 3 of 4
(2,767 Views)
Hi,

The behaviour that you reported is expected. Since you are calling the subvi in a loop, the execution control passes from the main vi to the subvi, comes back to the main vi, waits for the specified number of milliseconds, passes to the subvi again and so on until you hit the stop button. So in effect you do get access to the front panel of the main vi but its only for a split second until the control passes to the subvi again.

Try running your main vi in highlight execution mode with a constant 1000 wired to wait(ms) function. You will notice that that the subvi is being called indefinitely until you hit the stop button.This time, though, since you are waiting for a longer time(1 second) you have time to hit the stop button before the control passes to
the subvi again.

Regards,
Ankita A.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,767 Views)