Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with While Loop

Hi,
I've recently written a VI to control a triple output power supply with "store" and "recall" capabilities. So on the front panel I have a push button accompanied by a numeric control which specifies which memory location to recall the settings from.
Aswell as that, I have numeric controls for each of the three voltage channels and the whole VI is placed in a while loop.
when I run the program and push the recall button for say, memory location 2 the corresponding voltage settings are restored for a split second but returns to those settings I have already entered in the voltage numeric controls. Obviously this is happening because of the while loop, as the voltage value commands are continuously being sent and overwriting the memorys se
ttings.
So how do create the VI so as to run the program, and only change the values when the numeric control has been changed?
0 Kudos
Message 1 of 2
(2,841 Views)
The easiest way to do this is with an event structure. A very simple shipping example is called New Event Handler. With versions of LabVIEW without the event structure, the front panel controls would be polled and checked for a change by wiring the control to a shift register. The shipping example of this is called Old Event Handler (or maybe just Event Handler in older versions of LabVIEW).
0 Kudos
Message 2 of 2
(2,841 Views)