LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I turn off my computer when I push de STOP button from de program?

How can I turn off my computer when I push de STOP button from de program?
0 Kudos
Message 1 of 5
(3,009 Views)
There are a few ways to shut down the computer programmatically, for example have a look at this example. Just activate it when the stop button is pressed.
0 Kudos
Message 2 of 5
(3,009 Views)
Hello pon.

Download this example from this web.
http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=C95C015B6BCA7302E034080020E74861&p_node=DZ53008&p_submitted=N&p_rank=&p_answer=&p_source=External

Hope it helps you.
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 3 of 5
(3,009 Views)
You might also want to have a look at the old winutil>Windows API Function Utilities (32-bit) for LabVIEW. While they are written in LabVIEW 4.0 (!), they still seem to work fine under W2000 and LabVIEW 7.0. In particular, have a look at "exit windows.vi" inside "winevent.llb" of the above link. It calls the function "ExitWindowsEx" of user32.dll. Since this is part of the OS, you don't need to include extra DLLs.

(All the above assumes Windows OS. I don't know how to shutdown the OS on e.g. MAC or linux.)
0 Kudos
Message 4 of 5
(3,009 Views)
To shut down a Windows PC you have to call ExitWindowsEx function from user32.dll. You can use Exit Windows VI from the Windows API Function Library, if desired, to do this.
If you have Windows 2000/NT you need to have SE_SHUTDOWN_NAME privilege for your ADE.
From the following link you can download an example that set this privilege in case that you have Windows 2000/NT prior to executing ExitWindowsEx function:
http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3EE2756A4E034080020E74861&p_node=DZ53008&p_submitted=N&p_rank=&p_answer=&p_source=Internal

Hope this helps.
César Verdejo
Training and Certification | National Instruments
0 Kudos
Message 5 of 5
(3,009 Views)