Example Code

Step Through Values, Profile, or Array Using a While Loop

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 simple program allows a user to step through a predefined set of values in an array using a while loop. The array values are then sequentially available for any operations. This structure can also be used for simple custom profile creation.

Description:
The input array is populated with values of the users choosing which define the
Inside the while loop, the loop counter is used to index the array, and provides the value for further operations.
The stop condition for the loop is wired to the array size, and also the index number, so the loop stops when the count reaches the maximum dimension of the array.
A Wait timer is included as both good programming practice and to allow the execution to be watched.


Steps to implement or execute code
To implement this example:

  1. (Optional) Edit the value of the array as needed
  2. Run the VI
  3. Observe how the Current Value indicator change sequentially


To execute this example:

  1. Install the required software.
  2. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible

Hardware
-

 

bd.JPGfp.JPG

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

Regards,

Kyle M.
Applications Engineering
National Instruments

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