It's not a complete solution though- most serial UPSs come with drivers that
hook into Windows so the OS knows what state the power supply is, and can
shut down gracefully when the UPS battery expires.
To be able to access the serial port via Labview and poll the UPS directly,
you have to disable this driver, I think- otherwise you can't get at the
serial port that's in use by the UPS driver. This means the Labview software
will be aware of the problem, but the rest of the system no longer will be.
I guess as a bodge you can exec the "shutdown" command shipped with the NT
reskit while the Labview stuff is exiting- this can at least force all other
applications to close and then shut down the system, but there should be a
more elegant way
of hooking into the OS for this!
I've just had a look at my UPS software- an APC SmartUPS1000, and discovered
that in the configuration are all the actions to take place on certain
events, like loss of mains power and the low battery warning. As well as the
standard loggings and notification options you can also specify an
executable to run. Looks like for this brand of UPS at least it would be
simplest to have a set of Labview VIs that, when loaded, automatically run,
send a message to the main application informing it of the event and then
quit, and have the UPS software call these.
Kevin B. Kent wrote in message
news:3A562527.55A90BEC@usa.alcatel.com...
> Yes I beleive this is the solution you are looking for.
> Get a UPS that has a serial port and hook it to the serial
> port of the PC. You should be able to check it from there.
> Kevin
> Guangde Wang wrote: