LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

analog output control when labview application is terminated

I have a LabVIEW application that controls a pretty powerful motor via the analog output of a PCI-6259 board.  The board puts out zero volts on power up and my application takes over and controls it fine by setting different voltages for different speeds.  When the user exits the application, I stop the motor and all is well.

During a safety test, the customer decided to set the motor running and then aborted the program by way of the Task Manager.  Ouch...the motor keeps running at the last speed setting.  Not exactly normal operation but it did raise some concern.

My question:   Is there any method of setting the analog output back to zero output by some other means than LabVIEW? 

If not, I'm thinking of writing a small LabVIEW program that just keep checking if the main application is open. If it's not, it kills the motor.
I can then run this other program minimized or something.
0 Kudos
Message 1 of 8
(3,572 Views)

The Application Exit? event fires in an event-structure occurs when you try to end the labview task using task manager. This will give the opportunity to do some clean up code as long as its pretty quick.

David

Message 2 of 8
(3,567 Views)
Thanks David,
That may do the trick.


0 Kudos
Message 3 of 8
(3,553 Views)
When you have safety issues, software should not be the only means of control. For the case you decscribed a watchdog timer might be appropriate. This would consist of a simple hardware circuit (such as a retriggerable one-shot multivibrator and a relay). The watchdog monitors a line which is repeatedly pulsed by the software. If it stops pulsing for a time longer than the safety limit, the motor power is disabled by the relay.

Lynn
0 Kudos
Message 4 of 8
(3,543 Views)
This can be a real problem in any process control situation.  Computers crash...that's a fact of life.  And when they do, all bets are off when it comes to what current state the thing will end up in.   You definitely need some kind of external failsafe.  No matter how well you construct your VI, if it's not running, it can't help you! Perhaps a failsafe relay where the power to the motor is shut off if you get no data for a few seconds would do the job for you. 
 
Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 5 of 8
(3,543 Views)
Lynn & REric,
You ar both 100% right, of course, but I inherited the hardware and I'm only doing the LabVIEW application. I suggested additional circuitry but it won't be coming quickly so I need to explore software "fingers-in-the-dike" methods for now.  

I remember doing a motor controlled application some years ago using legacy NIDaq and an older PCI-E-series board.  I used two digital lines to keep a relay in a controlled state. One line had to be low and the other high. During power up, the lines would all go high together and then back low. when the LabVIEW app closed, the lines would all go low together.  
But DAQMx and the M-series board I'm using "remembers" the last state of DIO and Analog Out and latches it.

Thanks
0 Kudos
Message 6 of 8
(3,528 Views)
In your original post you described the problem as the user quitting LabVIEW without going through the shutdown procedure. If this happens an independent VI wil not help because it will also quit.

A separate executable running in the background might be useful, but it would need to have its own hardware because two different applications cannot control the same hardware simultaneously. Since you do not appear to have the opportunity to change the hardware, I do not see how this could help. And what if a sophisticated user also terminated the backup process?

Perhaps you should tell your safety engineer (and the customer's) that this safety issue cannot be addressed solely by software changes. If they are not willing to put in a good hardware watchdog (that can monitor the activity of the software), then you and your company will not be responsible for the safety of the system. Better, you will not release the system to them until the safeties are added. Managers more interested in short term financial gain (ship it so we can bill them) may balk at this, but do you want to be responsible for a system that hurts someone or damages expensive equipment?

Lynn
0 Kudos
Message 7 of 8
(3,506 Views)
Lynn.
I wasn't clear...I always build the LabVIEW VIs into an executable, which I refer to as the "application"..
The LabVIEW editor would not be open during normal operation.


And I'd build the monitoring VI into an executable, also.  I figure my monitor program would simply loop around checking if the main application was open and running.   If it wasn't, I would initialize the analog output and set it to 0.0 volts.  Perhaps a relay could be introduced as a backup.
 
I've played a bit with the event handler capturing the Application Exit and it may be useful, although it is not foolproof.


Safety has not been taken seriously with the hardware and it is certainly a problem.

Thanks for the input and sage advice



0 Kudos
Message 8 of 8
(3,499 Views)