06-28-2016 02:53 AM
Hi, I am new to LabView. I wrote a simple program to control a Keithley 2651 power supply. At the moment, if I encounter an error in my process i have to use the abort button that leaves my power supply in on state stuck supplying the current specified in the run that had the error. This can be very dangerous as we use current in excess of 8 Amps. So, I want to include an emergency stop button that returns my powersupply to its reset state (off) on pressing.
Please help
Cheers
06-28-2016 03:18 AM
Hi Tushki,
At the moment, if I encounter an error in my process i have to use the abort button
That's the main problem here!
Why did you program it this way? Why didn't you change it right now?
Use a statemachine approach instead of (nearly) endless running loops!
So, I want to include an emergency stop button that returns my powersupply to its reset state (off) on pressing.
That would be another state in your statemachine…
General note: Sometimes it helps to think about program design before starting to code… 😄
06-28-2016 09:54 AM - edited 06-28-2016 09:55 AM
Your loop can only stop if the stop button is FALSE and an error occurs in the VISA write of the FALSE case.. You also need to program some other exit strategies. 😄
To ensure a proper shutdown procedure, you need to hide the abort button and use an event structure to capture (and discard) window close events, so even if the user presses the X in the upper right, the correct voltages are set before the program ends itself.
You said you are a new programmer, so let me point out some other glaring problems: