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