LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Terminate Power Save Mode

Hello,

 

I am trying to figure out how to programmatically wake my computer when the screen saver is running and the PC is in power save mode. In the LV Developer Zone, I found the attached VI, Simulate_Mouse_Clicks.vi. The VI works to keep the computer from starting the screen saver and go into power save mode. But when the PC is already in power save mode and screen saver is already running, the computer does not wake up. The "Terminate Power-Off Mode" Call Library function does not appear to be working to wake the computer from power save mode when the screen saver is already running. My application requires the PC to be awaken by the LabVIEW VI when in power save mode.and the screen saver is running. 

 

Does any one have experience with this problem and can you offer a solution?

 

Regards,

Bill

 

Terminate power off mode function.png

[Post edited: .vi removed]

0 Kudos
Message 1 of 11
(4,243 Views)

Are you trying to prevent your computer from going into power save mode?  Or do you need to exit the power save mode because something happened?

 

I typically just disable the screen saver and power save mode in my deployed test systems.  Then I don't have to worry about this issue.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(4,237 Views)

I need a way to exit the power save mode and running screen saver programmatically using a running VI in LabVIEW. My problem is that if a screen saver is already on, it doesn't wake the computer from power save mode. I am not trying to prevent the computer from going into power save mode. Unfortunately, I am told that disabling the screen saver and power save mode is not an option.

 

 

Thanks,

Bill

0 Kudos
Message 3 of 11
(4,230 Views)

Then my question is when do you need to disable the power save?  You received a command from some USB device?  Network communication?

 

If you do it just because the power save is on, then you simply want to prevent it from happening in the first place.  So just have your little code that causes a mouse click execute in a loop something like once every 30 seconds.  I think you can also get away with just having the mouse move to prevent the screen saver from coming on.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 11
(4,227 Views)

The computer is triggered to wake up using the "Terminate Power-Off Mode" call library function when the RPM reading does not equal the previous RPM reading. But the Terminate Power-Off Mode does not work to wake up the computer when the computer is in power save mode and the screen saver is running. We are hoping there may be another way in LabVIEW that we have not found. They want the power save mode and screen saver to be active after a set amount of time when the condition RPM = Previous RPM remains true.

 

Thank you for your assistance..

 

Bill

0 Kudos
Message 5 of 11
(4,209 Views)

All,

 

Bill has started this thread for a project that I am working on.  Let me see if I can make the situation a bit clearer:

 

The project requires a screen saver to come on after a period of time if a certain event does not occur (this simply represents user interaction).  The event is an external controller that is being monitored through USB.

 

I need the screen saver to come on because it shows a marketing slideshow with a call to action to press a button on the external controller.

 

Here is where I need that event in the VI to terminate power save mode.

 

The biggest thing I can't wrap my head around is that drivers for a mouse or keyboard use some sort of this function but this particular function doesn't work.

 

Hope this helps,

 

James

0 Kudos
Message 6 of 11
(4,208 Views)

Now things make perfect sense. I will have to dig to see if I can find something else.  But since you are using USB, make sure the USB bus settings have their "power saving" feature turned off.  The last thing you want is to lose communication with your USB controller due to Windows trying to save power and turning off the USB bus.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 11
(4,189 Views)

James,

 

Make the slide show a LabVIEW VI and run it as part of your program. Then disable the screensaver and power saving option at the OS level. Get .jpg or .png files of the slide show from your marketing department. Place all of them in one directory with no other files. Use List Folder to get an array of filenames. In a loop read the files and display the images on a full screen picture control. You can place a transparent boolean button over the parts of the images where the user should click.

 

Lynn

0 Kudos
Message 8 of 11
(4,176 Views)

That is a great question.  The device I am using uses a standard FTDI driver and the manufacturer tells me that it supports remote wake up and power management (even though you cant see the settings in the device properties).  So I think the problem may result in the function.  I did some digging on the microsoft website and found the following refference to diableing the screen saver.

 

SPI_SETSCREENSAVEACTIVE
0x0011

Sets the state of the screen saver. The uiParam parameter specifies TRUE to activate screen saving, or FALSE to deactivate it.

If the machine has entered power saving mode or system lock state, an ERROR_OPERATION_IN_PROGRESS exception occurs.

 

From: http://msdn.microsoft.com/en-us/library/ms724947(v=vs.85).aspx#Screensaver

 

Which doesn't help much and most of the power functions look to be unsupported for win8.

 

Unfortnuately, I don't have much time to create a screensaver in labview and integrate it into the program.

 

If you guys have any other suggestions, it would be most appreciated.

 

James

0 Kudos
Message 9 of 11
(4,120 Views)

Hello,

 

Just looking around, I saw some suggestions for using the Microsoft Powercfg command for controlling power settings on computers. Not sure if it's exactly what you need, but thought it was worth mentioning!

Taylor B.
National Instruments
0 Kudos
Message 10 of 11
(4,070 Views)