LabWindows/CVI

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 3
(3,353 Views)
For now, I would recommend checking for the specific error for about a minute.  If the error does not clear after a minute, then I might notify the user with a prompt asking if they want to continue waiting or to exit.  I will put in a product suggestion for this issue.  Also, you might want to consider using LabVIEW Real-Time operating system (if possible).  This makes this sort of thing a non-issue. 
 
Hope this helps!!
Daniel Eaton
National Instruments
Systems Engineering
Embedded and Industrial Control
0 Kudos
Message 2 of 3
(3,328 Views)

Thanks Daniel,

I spent a few hours modifying my code to check for these error instances and now it all runs quite smoothly.

The first instance of a startup error was during loading of a dynamic VI reference. It would report that it couldn't find any of the subVIs. I have made a loop to load the VI refenence and if there is an error, close it and try again. It takes about 30 seconds before it successfully loads.

The next problem VI was 'initialize controller' from the motion package. After a few tried calling this function it comes good and after that I had no problems.

For my next NI project I'll seriously consider the real time package. At least I know its been tried and tested.

 

Thanks,

David 

0 Kudos
Message 3 of 3
(3,306 Views)