Example Code

Utilizing Command Prompt using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview
This simple program utilizes command lines along with the System Exec function to allow the user to shut down, restart, log off and access the shutdown options windows dialog.

 


Description
User event based programming with an event case for each of the buttons on the front panel. In each case the System Exec function is used to send a system command to the command line application. This tool could be usefully integrated into VIs where the user does not get access to windows or integrate to programmatically shutdown our LabVIEW application upon completion.


Requirements

  • LabVIEW Base Development System 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached VI to your computer
  2. Open the VI "Shutdown 2012 NIVerified.vi"
  3. Run the program

 

Additional Information or References
VI Front Panel

f.png

 

VI Block Diagram

 b.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Aaron. E
Product Performance Engineer
Dyson

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.