LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

while loop problem

For repeating block diagram code i placed my code in a while loop...but
something is not clear for me :

1] It's possible to create a button on the front panel which pause/unpause
the vi when pressed ?

2] If i use this vi as a sub vi when i call it from a button in the
principal vi it runs continuously until i press a button .Things seem to
work but problems grow when i want this subvi to pass a result to a
principal vi.indicator.If i use a subvi without while loop there are no
problem but when i use my subvi with a while structure after i close it no
value return to the principal vi's indicator...what's wrong??

Thanks a lot in advance
Horackz
0 Kudos
Message 1 of 3
(2,670 Views)
Hi,

1) About "Pause" button: there is not built-in pause button in LabVIEW. You must write code yourself. Usually you can write empty while loop that just waits until button is pressed.

2) I don't understand your problem. Can you post your vi or image of your diagram. It will be more easy to help you.

Nadav.
0 Kudos
Message 2 of 3
(2,670 Views)
As far as the subVI issue, your problem could be that the while loop is running continuously when called from the top-level VI and that's why it returns nothing. You will need a way to stop the while loop in the lower-level VI so that you can stop it from your top-level VI. The best way is to have a button input which stops your while loop (assuming you have already done this in your while loop).
J.R. Allen
0 Kudos
Message 3 of 3
(2,670 Views)