LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running a vi. continuously and changing it's status via a front pannel action

Hi
 
I want to run a vi in two modes.  How can I switch between two cases via a front panel action, rather than stopping the vi, changing the action via a menu ring and then restarting?
 
I guess I need to use some of the occurrences functions.  I have not yet used these so I am a bit confused how to get started.  Does anybody have some example code that might help me on my way?
 
Many Thanks.
 
Ashley.
0 Kudos
Message 1 of 4
(2,692 Views)
Hello Ashley,

you already named it: "two cases". Why not put a case structure in your vi, connect it with the switch and setup the required "mode" in each case?
You can connect many types of controls to a case, not just boolean. (But: when you use other types be sure to define a default case.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,688 Views)

Thanks Gerd

I guess if the vi is running continuously in a while loop, the boolean operation of on/off attached to the case structure will switch status for the user.

Thanks

Ashley

0 Kudos
Message 3 of 4
(2,674 Views)
Hello Ashley,

your right, to run a vi continuously you should (always) use a while loop. And don't forget a timer function inside the loop to limit the speed!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,671 Views)