LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shut down PC after exiting from labview application.

Solved!
Go to solution

Dear Friends,

 

        I want to make application in labview in such a way that... when somebody will start PC that labview application should start running. and PC should not be able to do any other task instead of running labview application. and PC should get shutdown after exiting from labview applicatin. please tell me how to do this.

 

Regards,

Vijtin

0 Kudos
Message 1 of 15
(6,679 Views)
this command http://www.computerhope.com/shutdown.htm, via "system exec vi" Just remember to close files etc. before you use it


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 15
(6,674 Views)

Assuming Windows...

 

For the other two parts you will need to do this yourself with the operating system.

 

To start the app you first need to indicate whether the application should start when the PC starts, or after someone has logged on. The former requires that you create a service (do a search as this part has been asked many times). The latter can be as simple as placing a shortcut in the "Startup" program folder.

 

To not have the PC do other tasks then you need to configure the computer's services, see what's necessary, and what's not, and see what else is starting up when your PC boots. This forum would be the wrong place to get help on this. Your best bet is to search the internet on how to understand what the various services are, whether you need them, and how to turn them off. blackviper.com is a good place to start, but you should not use it as the sole source of information.

0 Kudos
Message 3 of 15
(6,660 Views)

Hi Vitjin,

 

As far as your shutting down your pc after your labview application you can do that in two ways:

1.  Using the System Exec VI

Shutdown is achieved by passing the system-level command: cmd.exe /C shutdown -r -m \\computername -t 5 -f

This command translates to shutting down the computer (named computername) with a timeout of 5 seconds, forcing all running applications to close without warning.

 

2 Using the Call Library Function Node

This method accesses the user32.dll and utilizes the ExitWindowsEx function to perform a Windows shutdown.  uFlags set to zero forces a shutdown of all processes and then logs off the user; setting dwReason to zero indicates the reason for shutdown is related to "some other issue."  If the function return is not equal to zero, then the function executed successfully.

Message 4 of 15
(6,623 Views)

I forgot to mention I have attached a code for shutting down the pc.

Check it and let me know if you need any further help.

Cheers..!!!

0 Kudos
Message 5 of 15
(6,622 Views)

Thanks for sharing that functionality, Priyank.

Kudos.

Vaibhav
0 Kudos
Message 6 of 15
(6,605 Views)

Hii

Thanx for support...

Actually i am working on Labview7.0 so pl send me code for shutting down the pc in Labview7.0.

 

vijtin

0 Kudos
Message 7 of 15
(6,550 Views)
Solution
Accepted by topic author vijtin

I think you are able to reconstruct it from a picture (I can not save to 7.0). If not you have to take a Labview course like "introduction to introduction for Labview programmers" And If you see in my first posting to you you will find the description for the shutdown command.

sample.PNG



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 8 of 15
(6,538 Views)

Hi Vitjin,

 

As you mentioned you have labview 7 what i can suggest you is to go to labview search and find "Sytem Exec. vi" and put that on your block diagram. Then right click on the command line input and create constant and write "shutdown -s -f." And then when you run this vi your pc will shutdown. Moreover I have labview 7.1 and I have attached a labview 7.1 vi if its helpful to you. Let me know if you need any other help.

 

 

 

Message 9 of 15
(6,504 Views)

Thanks for giving solution.

 

 

Can you please tell me what command or what tool can be use to disable any other task of PC while running Labview application.

 

Regards,

Vijtin

0 Kudos
Message 10 of 15
(6,494 Views)