LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to shut down the computer from Labview (Win 2000)

Problem to shut down the computer from LabView (Win 2000) I need to shut down the computer with LabView automatically: I found the vi "Exit Windows (NT-2000).vi" and tried it with NT: it works!

I tried it with Win 2000 and I get Win 2000 almost shut down except that i came a message "You can shut down your computer now" and the PC did not shut down.

I also could not find a vi named "Message Window Dialog Box w/Sound.vi" (Il should be vi a library "Winevent.llb" that I could not found).
Has anyone an idea how to solve the problem?
Thanks for your help!
Roland
0 Kudos
Message 1 of 7
(4,206 Views)
For the VI you are looking for, try this lvutil32.zip.
Regarding the windows shutdown, I noticed that some Exit windows VIs have the option for displaying that message as default TRUE. If you are using one of those, make sure you have a FALSE input for it.

Hope this helps
0 Kudos
Message 2 of 7
(4,206 Views)
Probably he's talking about windows' message (like when your computer does not have a ATX power source and cannot shutdown by itself).
0 Kudos
Message 3 of 7
(4,206 Views)
That is exactly that! But my computer is able to shut down by itself!
I got the Winevent.llb but the problem is still there: I got the window's message "You can shut down your computer now."

Any other idea how to solve the problem?

Thank for your help!

Roland
0 Kudos
Message 4 of 7
(4,206 Views)
I experienced the same problem...
..has any one an idea how to solve the problem?

Olivier
0 Kudos
Message 5 of 7
(4,206 Views)
THe original post is not here, so I will guess that you want to shutdown
windows from labview...


all you have to do is make the appropriate call to kernel32.dll in
windows. call the shutdown function.

msdn.microsoft.com will be the place to look

good luck!

-Jason Richmond
Project Engineer II
LabVIEW Advanced Application Development Instructor
VI Engineering
651-484-1332 x319


Olivier wrote:
> I experienced the same problem...
> .has any one an idea how to solve the problem?
>
> Olivier
0 Kudos
Message 6 of 7
(4,206 Views)
I've worked around extensively on that exact problem, and I think I've finally got the answer. The value that must be passed to the user32 library is "12" (decimal) for the system to shut down silently. Really, that value means "power off", while the "5" passed when you select the "shut down" option means "force shut down", which exits windows but does not power off the PC.

(More info at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/exitwindowsex.asp )

So, what you must do is either adding an option to the "Exit Windows..." vi giving the correct value or directly passing the value "12" into the "ReturnCode" field of that dll.

I attach the modified VI which powers off the system straightforward (NT-2000-¿XP?). Hope i
t works fine.

Felipe
0 Kudos
Message 7 of 7
(4,206 Views)