Example Code

LabVIEW 3-State Logic Compare

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 compares inputs X and Y and returns X<Y, X=Y, or X>Y as a string output.


Description
A simple and useful VI that can either be used or easily added into a larger program with the drag-and-drop Snippet below. Two-users' defined inputs are subtracted, and the sign of the result (-1, 0, +1) is found by using the Sign.vi. By adding 1, a line-index is now created to be used with the Pick Line.vi, which outputs our logic comparison as a string.

 
Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Open " 3 State Logic Compare 2012 NIVerified.vi."
  2. Specify your desired numerical inputs for X and Y.
  3. Run the program.

 

Additional Information or References
VI Block Diagram

 5-55.png

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

Huntington W
National Instruments
Applications Engineer

***Don't forget to give Kudos and Accepted as Solution where it is deserved***

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