Example Code

Programmatically Reset VI Example

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

Overview

This VI illlustrates using the Default Values:Reinitialize All To Default method in VI Server to reset the VI controls and indicators to their default values.

 

Description

This VI demonstrates how you can use the Reinitialize All To Default method in VI Server to restore the default instance. This VI can be used in an instance where you wish to refresh or restart a VI returning all values to their default settings. Note that if your VI has other entities in it that retain state, such as shift registers, you would need to clear those as well within the "Reset" case.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

1. Download and Unzip the compressed folder

2. Open the VI "Programmatically Reset VIs_LV2012_NI Verified.vi"

3. Enter a Coefficient value to multiply the random number and display the result in Scaled Value

4. Click on Reset VI and notice how the controls and indicators reinitialize to default
5. Stop the VI

 

Additional Information or References

Check the block digram to view the different states in the program

 Programmatically Reset VI.PNG

 

 

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


Thank You
Eric Reid
National Instruments
Motion R&D

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

Comments
chris.b
NI Employee (retired)
on

Hey Eric R,

Would this more accurately be title "Programmatically Restart VI Example" ?

The current title sounds like it will Restart LabVIEW...

Chris Bolin
LabVIEW Partner Program, CLA
Eric_R
NI Employee (retired)
on

noted sir


Thank You
Eric Reid
National Instruments
Motion R&D
labview4steve
Member
Member
on

Hey Eric, Apparently you are still fooling people... I came here thinking you had a way to restart LabVIEW not just re-initialise a VI......
.