06-27-2018 10:34 AM
Hi all, what I'm trying to do is to pause a labview vi (the vi take continous measurements through an usb sensor) execution if the PC enters a stand by or hibernation state because of power issues. Any ideas on how to do this programmatically?
I'm programming this on windows 10 with labview 2016.
Thanks
Carlos
06-27-2018 10:40 AM
I think the best thing to do is set the PC so that it doesn't go into hibernation.
Now if there are power issues such as loss of Main AC Power, there isn't much you can do easily. Lose power, your PC goes down and there is no pausing. You could set your PC's BIOS to automatically reboot boot after power loss. You could create a an application or service that runs automatically on startup.
If power loss is a big concern, you should get a battery backup for the PC. Many brands (I know APC does) can communicate with the PC about its status. There is a LabVIEW example out there that can read that status so you can build it into your app to detect when it went on battery and allow your VI got go into this "pause" state programmatically.
06-27-2018 10:49 AM
Thank you, that is a good answer, I will take a look for the vi you mentioned,
regards
06-27-2018 08:52 PM
I had a chance to search for what I've used in the past which was found here.
06-28-2018 06:10 AM
@fmow wrote:
Hi all, what I'm trying to do is to pause a labview vi (the vi take continous measurements through an usb sensor) execution if the PC enters a stand by or hibernation state because of power issues. Any ideas on how to do this programmatically?
Wouldn't the VI automatically pause when the PC goes into hibernation or sleep
?
The .net event is the way to go if you want your program to go to a controlled pause state on power state change.
07-10-2018 03:04 PM
If you'd like to prevent your computer from sleeping/hibernating programatically then please check out my Power Requests VIs at : https://github.com/benmanthey/Power-Requests.
Don't make your user search through settings, do it with your program.
07-10-2018 03:29 PM
Thanks Ben