Know when the computer goes to sleep mode
4 次查看(过去 30 天)
显示 更早的评论
Hello,
I write here today because I would like to know if it is possible, when I launch a function in Matlab, to get the time before the computer goes to sleep mode.
Why? Because I am developing a GUI which communicate with electronic devices (oscilloscope and function generators) and I have a mode "oscilloscope" in my GUI which permits to the user to see the signals he wants (I get the signals from the oscilloscope and refresh with a timer). BUT, I intend the case where the user leave the computer and let the function generators output on "ON" and the oscilloscope in the "NORMAL" mode. And what I wish is to stop the acquisition of the oscilloscope just before the computer goes to sleep and then avoid to let the oscilloscope acquired hours and hours for nothing.
I know that in a previous program on Matlab I used getenv('PROGRAMDATA') to find the folder ProgramData of Windows. But the documentation is not really provided for this function. Maybe I have to continue my research in this direction?
The last information I have is I am using insomnia function (from FileExchange) which permit to avoid the computer goes to sleep, but it is not what I want.
I thank you in advance for all advice you could give me.
Best regards
0 个评论
采纳的回答
KSSV
2016-6-17
Interesting question....I am not an expert. A wild suggestion/ advice. I guess you can control the sleep, wake activities through dos prompt. We can run dos prompt in matlab. The following link might give an insight on how to control sleep through cmd.
5 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!