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!