From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use event structure and while loop in parallel

Hello, I would like to use an event structure in parallel with a while loop. I have a camera that needs to constantly take pictures and I have that setup in the while loop. I also however need to do other functions in conjunction with the picture taking. I have about 50 or so events that need to have access to while the pictures are taken. Is there any way to do this? If not is there any way to have a global stop variable that is attached to all 50 of the events. I know I can do this the hard way and have each boolean event in the event structure be attached to the while loop stop control. This is however very inefficient. I would also like to know if I can simply use a mouse click as the stop of the while loop. Am I able to have a variable that goes from false to true on mouse click without using the event structure to do this? Thanks.
0 Kudos
Message 1 of 3
(3,553 Views)

Yes, just place the event structure in a second while loop.

Add a stop button to the other while loop and add an event for the stop button to stop both loops. For a simple example, see my VI posted here:

http://forums.ni.com/ni/board/message?board.id=170&message.id=176367&jump=true

Simply add more event cases as needed.

 

 

Message 2 of 3
(3,549 Views)

Excellent example, it helped me alot in a problem that i was having!

 

Thank you,

 

Best Regards,

 

João.

0 Kudos
Message 3 of 3
(2,564 Views)