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: 

LabVIEW application fails to run properly at Windows startup

I have experienced problems with my Labview application after putting it in the Windows XP startup folder. The application runs perfectly if I start it manually but whenever I get Windows XP to start it after boot-up, I see various error messages. My application uses calls to the NIMotion library and it's these calls that are generating the error messages. I don't always get the same errors and the problem has occurred with two different programs on two different computers. I think it is something to do with NI services for the motion controller that load at startup and haven't yet been started before my application runs. I have configured Windows to login automatically and I have noticed thay my program executes quite early, sometimes even before the desktop icons appear.
 
I have seen that a number of other users have experienced similar problems. There was a recent post titled "Waiting for Windows Idle" in the LabWindoesCVI forum that is related. The only solution that I have come across is to wait at the very start of the program until the rest of the dependent services have loaded. I have added a 30 second wait to my programs and this appears to have largely solved the problem. This is no the best solution because it is not always guaranteed to work. I have had a situation recently where Windows was installing an automatic update and the bootup process was slower than normal. This caused my program to fall over again. I don't wan't to extend this time too much or the user will be waiting every time the machine is turned on.
 
Another solution would be to check for those specific errors that are generated and keep trying the function calls until they are successful. I have not tried to do this yet. It would probably be quite time consuming process to write the code to process the errors because I need to build an executable and reboot everytime I want to test. And again this method is not guaranteed to catch all errors. Surely there must be a better way. I have done some initial investigation into the Windows Service Manager but haven't got too far. I've discovered I'm not a Windows programmer and I don't know what all those NI services listed under "Administrative Tools" actually do. Surely there must be some better way or some tool out there that can check that Windows has finished loading?
 
David Reeves
0 Kudos
Message 1 of 5
(2,549 Views)
One thing you could do is write a routine that tries to talk to all the various things (like the motion control) that have to load. This subVI would sit in a loop until it either successfully contacts everything or some long timeout expires - in which case it would return an error...

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 2 of 5
(2,541 Views)

Sorry dreeves, I don't have an answer for you. I would like to know the solution myself. I had similar problems recovering from a standby state.

DAQmx takes a while to get going for USB devices and the queue functions didn't recover properly at all.  I just sat in a loop checking the status of my attached devices until they initialised properly then moved on from there.

It would be great if there was some way to check the status if the various LabVIEW modules that load on startup. Then, when all the ones you need are ready, continue with the rest of your application.

I would think checking LabVIEW for its status would be more reliable then asking Windows if it has finished starting up.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 3 of 5
(2,539 Views)

Thanks, I should try something like this again. When I first encountered this problem a while ago I believe I did something similar. I made a loop with the 'Initialise Controller' VI and waited until it executed successfully. From what I remember, it would then sometimes generate an error with another motion VI further on. At that point I gave up and just went for the simple delay option. I might go back and put some more effort into investigating your suggestion again. It would be a better solution than what I have at the moment.

David

0 Kudos
Message 4 of 5
(2,530 Views)
hai dreeves,
 
         check with some of the printer drivers installed in your PC could disable the NI drivers functions, some time it denies the access of the NI Drivers while loading, I think this might solve the problem.
0 Kudos
Message 5 of 5
(2,519 Views)