Example Code

Search a Specific String and Return its Corresponding Associated Value in 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

From a multi-line string, search for a location name and return the ID number.

 

Description

This example uses basic string manipulation to search a multi-line string, for a location. Once the location is found, the corresponding ID number is returned. Note that this example assumes the source string is of a specific format. This can be seen in the attached vi below.

 

Requirements

  • LabVIEW 2013 (or compatible)

 

Steps to Implement or Execute Code

  1. Place the desired location string in the control, an example string has been included as default values
  2. Run the program
  3. Notice that the ID that corresponds to the location is now displayed

 

Additional Information or References

Capture.JPG

 

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

Matt H
Applications Engineer
National Instruments UK

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