ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exit program from inner loop

Solved!
Go to solution

Hi im all new to Labview so this might seem like an easy problem to solve.

 

Im simulating a signal and displaying it on a graph when i click a start button. But i can't figure out how to still being able to exit the whole program from an exit button as long as im in the inner loop that simulates the signal. When i click the Exit button when simulating nothing happens until i press the button to exit the inner loop.

Heres a small example vi demonstrating my problem:

 

 

0 Kudos
Message 1 of 3
(2,863 Views)

Hi Dennis,

 

while using an event structure is ok you should consider to never do any long-lasting tasks inside the event case as this will block other cases - and even UI handling if not set properly.

 

Solution will be to separate event structure/UI handling and DAQ parts...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,853 Views)
Solution
Accepted by Dennis Francek

 SImply follow a few simple rules:

 

  • Don't put interactive while loops inside events
  • Don't put events inside events.

 

You can use the outer while loop for everything.

 

Some related threads:

 

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=388255#M388255

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=224817#M224817

 

(there are many more)

 

Message 3 of 3
(2,845 Views)