LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

jump to previous part of code

As is standard, in my program I begin by preforming certain initializing steps, and follow that up with a while loop. I want to know if it is possible, given a user-event, to break out of the while-loop and revert back to the initializing part of my code.

Thanks,
David
0 Kudos
Message 1 of 3
(2,662 Views)
David,

Look at the Producer/Consumer design pattern which ships with LV.

At a minimum you will want to configure your system as a state machine with the initialization code in an Initialization state within the loop so that it can be called again when required.

Lynn
0 Kudos
Message 2 of 3
(2,657 Views)
Another possibility is to use an event structure, with the ini section called in one event case, the main "loop" being performed in the "timeout" event case. Setting the timeout value fairly low allows the loop to execute fast. By putting a case structure in the timeout you can have it execute that portion only after certain prerequisites are met, i.e. initialization, but you can jump back to the initialization state. Otherwise you will have to have some mechanism to stop the loop to return to the other state.


Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



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