LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop button isn't shutting down program running laser

Hello all,

 

I have this program here that I want to use to run a CO2 laser, and for obvious reasons i'd like to have a stop button on the program that shuts everything off in case something untoward were to happen. The problem im having is that the button must not be coded correctly because it doesn't work at all, and this can make things potentially dangerous. The program is ment to ramp the laser power up to a specific power at a set rate, stay there for a set amount of time, and then ramp down at a set rate.

 

Does anyone have any way to fix this stop button problem?

 

 

Cheers!

0 Kudos
Message 1 of 7
(3,835 Views)

Your stop button isn't wired to anything except for the controls that stop the loops that run your function generator.  The function generator doesn't know to turn off unless you send it a signal to do so.

 

Basically, you need to have the "stop" button in your inner loop call the "output enabled" VI set to FALSE if the "stop" reads TRUE.  And you need to make sure to have that run after the signal it gets every single loop to turn itself on (which you really ought to only call one time, instead of during every loop).

0 Kudos
Message 2 of 7
(3,818 Views)

Owwwwwwwww...I'm blinded by the purple front panel!  Do yourself and your users a favor and just use the default colors.

 

As far as your code,  I very highly recommend using a State Machine.  A loop inside of another loop is typically a sign that something is really wrong.  One of your states should be "Idle" or "Wait" that uses an Event Structure to watch for the user pressing buttons.  From that, you can key off of the user pressing the stop button and shut down the system.  The Event Structure also allows for a timeout to allow for the timing of your ramping.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 7
(3,816 Views)
I can't look at your VI because I am on my cell phone at the moment, so I'll give some general advice. First, if you have not gone through the online tutorials, they should be your first stop.

Second, you should consider a state machine structure so the program will always be able to respond to the button press.

Third, if it is a matter of safety, the button should be in hardware. Preferably a large red button with a mushroom top that cuts power to the laser no matter what.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 7
(3,806 Views)
Purple front panel? You work for Corning, right?

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 7
(3,797 Views)

I'm looking at how to build state machines now, I've been recomended them before but I have not ever coded one. We do have an actual stop switch to the laser that kills all the power to it in case something goes wrong, but it would be nice to be able to kill the code with one push of a button as well so the DAQ and function generator stop sending voltages

0 Kudos
Message 6 of 7
(3,776 Views)