From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lauch a LabVIEW VI on boot or restart

For starters:  The problem is that we have numerous power problems at my lab. So I loose control of my system when the computer momentarily shuts down. When the computer restarts I would like for the main control vi to launch and run so that the valves I am controlling return to a safe defualt state. 
 
To accomplish this, I need to get the main control vi to launch on Windows start-up.  I understand from previous threads that there may be some timing nuance to this process. And I understand that this is probably something that is best accomplished using the Autoexec.BAT file.   But if anyone has any hints or words of wisdom I would appreciate them greatly. 
 
PS - A UPS would be a great fix but is currently out of my price range, and may be overkill.
0 Kudos
Message 1 of 18
(4,346 Views)
Incidentally, I do have application builder.  So I welcome advice on how to configure a labview executable to launch at start-up as well.
 
0 Kudos
Message 2 of 18
(4,338 Views)

Try putting the vi in here.

C:\Documents and Settings\All Users\Start Menu\Programs\Startup

0 Kudos
Message 3 of 18
(4,329 Views)


@JHourigan wrote:
For starters:  The problem is that we have numerous power problems at my lab. So I lose control of my system when the computer momentarily shuts down. When the computer restarts I would like for the main control vi to launch and run so that the valves I am controlling return to a safe defualt state. 
 
To accomplish this, I need to get the main control vi to launch on Windows start-up.  I understand from previous threads that there may be some timing nuance to this process. And I understand that this is probably something that is best accomplished using the Autoexec.BAT file.   But if anyone has any hints or words of wisdom I would appreciate them greatly. 
 
PS - A UPS would be a great fix but is currently out of my price range, and may be overkill.


I think you really need to rethink your priorities here!

You know you have a numerous power problems.  You need the computer to restart automatically so the valves can return to a safe state.  And you say a UPS is too expensive,  i.e. "out of your price range"?  What is your price on safety?!!!

A good normal size UPS for a desktop computer runs $100-$150 US.  If you bought it to begin with, it would have already paid for itself!

You don't say if your power problems are just affecting your PC, or are affecting your system as well.  Let's assume it is just the PC.  A UPS will let it ride through shorter durations.  You can use a relay with the coil directly connected to non-backed up power to detect whether you've lost power.  The contacts on the relay could be fed into a digital input that your software monitors.  You can put in code that directs the system to shutdown the valves and then the PC if the power outage lasts too long.

If it is a case of your whole system losing power, and if the power that the valves need is not high power or high voltage, you could direct the power from the UPS to control them so that you can still return the valves to the "safe state" even if power to your whole system is out.

If your whole system is so big and powerful that a normal PC UPS can't support it, then high power battery backup, generator, whatever, should have been budgeted into the system when it was first designed and installed.

If you are controlling real life equipment that has a hazardous potential, safety should be at the top of your priority list.  If you can't afford safety, you shouldn't be doing whatever it is your trying to do!


 

Message 4 of 18
(4,316 Views)

Ravens Fan is out of his or her element telling me how to set my lab builiding priorities.  And his or her reply is neither constructive nor  in the spirit of the NI discussion forum.

This is an academic lab where decisions have to be made based on budgetary constraints.  I am looking for a low-cost software fix to this rather than a high cost (>$1500 + recurring maintence) hardware fix  Let's just say that a "small" UPC won't cut it and there are not an human safety issues. If specifics are needed, I have an ultra high vacuum system with normally closed pneumatically actuated valves. Normally closed works for all but one of these valves - the one that is used to isolate the turbo molecular pump from the foreline and rotary vane pump.  The turbo pumping station will often spin back up after a power glitch while the computer goes through a restart cycle. This leaves the turbo spinning into a closed foreline. While not a major issue, it would be nice to open the foreline valve as the computer boots back up. 

A Festo valve manifold  that operates on 24V logic controls airflow  to the actuators. The 24V is supplied to the solenoid via an NI USB Digital Output device. When the power cycles the Festo solenoids all close, closing the UHV valves leaving the line protected from venting.  If the PC were to be on a small UPC it would leave the valves open while the pumps spun down, potentially venting the line. 

In an ideal world the one foreline isolation valve would open up when power was restored.  The simplest way of accomplishing this would be to have my systems control code launch at start-up; it would go through initialization and put the valves into a default state.

So I will repeat my question from is there a way to get Labview and a specifc VI to launch at startup

Constructive replies welcome

0 Kudos
Message 5 of 18
(4,301 Views)
Either I missed it or you did not write it - how do you control the valves? Do you use a PC internal card or for instance Fieldpoint? This could make a big difference as for instance Fieldpoint modules can be configured to have specific power up output values.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 18
(4,293 Views)
Wow a flame war on UPS (although I am on Ravens side).

But since you are asking for something else. (this goes only for 8.x):

Create an executable with your program. I advise you to alwasy work with executables not VIs in the Development environment.

Create an installer to install your progam, and let it install anywhere.
In the 'Shortcuts' tab select your executable and put it in the startup folder without any subfolder:


Ton

Message Edited by TonP on 06-28-2007 07:33 AM

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 7 of 18
(4,292 Views)
Your words:
 
"The problem is that we have numerous power problems at my lab. So I lose control of my system when the computer momentarily shuts down. When the computer restarts I would like for the main control vi to launch and run so that the valves I am controlling return to a safe default state."
 
"Numerous problems", "lose control", "safe default state".
 
If a simple software fix is able to handle what you want, then a simple hardware fix like a $100 UPS should be able to do that job to.  You are the one who said you need to have the valves return to a "safe" position.  So if they don't return to that position, then they are "unsafe"?  What if the power is out for an hour?  What is happening while those valves are in an "unsafe" position?  If you are dealing with momentary power glitches, wouldn't you want to ride through rather than having a whole system shut down and wait for a PC to reboot and your control program to restart?
 
Yes I agree that a $1500 backup system could be out of your budget.  I don't know what your lab is doing, or what the hazard potential is.  If it is truly hazardous, and you need a $1500 backup to protect yourself, the people working in our lab, and your neighbors, you better buy it.  If you have no serious hazard, then maybe a software fix would be fine.  I think if a software fix is truly safe enough for you, a $100 UPS would be better.
 
I work in a lab and am using Labview to control real life equipment.  Some rotating at 16,000 RPM, some loading up samples with 30,000 lbs of force.  If power goes out, I want to make sure the Labview computer is able to shut down cleanly and reset and relays to a safe state.  Their is a serious physical hazard and I want to do all I can to keep my coworkers and myself safe.  I am not out of my element when it comes to building lab equipment.
 
Excuse me.  I am not trying to start a flame war.  But based on your words, you have a recurring issue that involves safety that causes you to lose control of your system.  I wouldn't trust a PC hack to protect yourself.
 
You can use Labview and a digital input to detect the status of your power.  If it detects you lost power, you can have the program command the valves to close.  Log the date and time that it happened.  Have the program shut things down orderly before the battery backup would lose power.
 
All that said, if you have adequately evaluated all the possible scenarios and feel a reboot type setup is all you truly need, then I am certain the suggestions you have already received will work.
 
 
Message 8 of 18
(4,254 Views)

Ravens Fan -  thanks for the UPS suggestions and monitoring power loss.  There is nothing that will injure people in my lab, mostly vacuum generation, motion and vision, and mass spectrometery. There is no safety hazard posed to lab workers should the power go out.

Unfortunately I work on a university campus where power outages, particularly in the winter are not infrequent (3-4 times per year) and emergency power is supplied only to the most sensitive of instruments, a cateqory into which my equipment does not fall unfortunately.  This condition is not really acceptable, but it is a university infrastructure issue that is far beyond my control.

"Safe" in "Safe Default Mode" refers to the valves being closed to the possibility of venting to atmosphere if the turbomolecular pumps spin down. This is accomplished when the power cycles. All the digital outs on the NI USB digital output are reset and the solenoids which deliver air to the pneumatic actuators close.  I have gone through several of these power cycles to date without incident and the vacuum is maintained.  However, I am about to add another valve in the foreline region of the turbo molecular pumping station which I would prefer to be open, unfortunately I currently possed only a normally closed valve.  I would like the foreline to valve to open upon return of power so that the pressure gradient is maintained and the pump does not back stream. In my particular case, "unsafe" is prolonged (>12hrs) closure of this foreline valve and the risks of backstreaming in this case are still minor.   I'm most worried about the weekend power glitch when the pumps restart and the computer restarts but the one valve remains closed.  I agree that Raven Fans' event logging would allow a message to be sent to a phone or pager, which is an attractive feature. But it would be nice to just have the computer put the valves into a default mode unprompted by external user input.

So ultimately, this is a convenience rather than a safety issue. 

0 Kudos
Message 9 of 18
(4,231 Views)
JHourigan,
 
Your system picture is a bit clearer to me now in terms of what is happening with the valves and what that means in terms of safety.
 
There are 2 things that concern me about relying on a computer restart and the program restarting automatically.
1.  The computer must restart when the power comes on.  By default, most computers once they lose power will stay off even if the power comes back.  But I think there is a way to get them to reboot on return of power by way of a BIOS setting.  I haven't needed to do that before so I'm not sure if any and all computers are setup that way.  (At least new computers, where the power button just tells the computer to turn on and off, as opposed to the old days where you had a real power switch where if it was on the PC got power and would start, if it was off, the thing was off.)  So you need to have a way for the PC to automatically turn on when the power returns.
 
2.  If the computer reboots, will Windows (I'm assuming you have windows, maybe you have a Mac or Linux) automatically restart.  On my PC, I put outlook in my start directory so e-mail comes up as soon as I login.  But it requires me to login to do that.  The computer when it boots will just sit waiting at a login screen.  If you are able to set up the PC to login in automatically once it boots up, then you will be fine.
 
If these two things don't happen, then putting the VI or .exe in the start menu isn't going to help.
 
You may want to consider hardwiring in some sort of relay interlock.  Do the motors start automatically because they directly connect to line power, or do they have a motor controller either for start up or speed control driving them?  If you can have a relay that automatically forces the valves to reopen when the motor is running (either by detecting voltage going to the motor, or some sort of auxiliary contact on the controller), that should guarantee the vents open when the motor is on and close when it is off.
 
I still think an inexpensive UPS for the PC would help in a lot of scenarios (minor glitches or short term outages of less than an hour), but may not help or may even complicate the situation for long term problems like a 12 hour outage.  In that situation, you may need to rely on the computer being able to turn on, boot up, and guarantee the VI or exe restarts.  Or rely on the relay interlock where a running motor forces the valves to open whatever the status of the PC and Labview is.  I think it would even be possible in the relay interlock that the forced valves only occur when Labview is not in control.  It would just be a little creative relay logic.
 
Good luck.  And please report back what your final solution turns out to be.
0 Kudos
Message 10 of 18
(4,207 Views)