Example Code

Resistor Calculator Example 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

Overview

This example calculates the theoretical value of the resistor based on the supplied band colors.

 

Requirements

LabVIEW Base Development System 2012 or compatible

 

Description

 This VI takes an input of 3 different resistance band colors and calculates the resistance of the corresponding resistor. The VI utilizes case structures for each popssible color, and contains the value for the specific resistance. There is also a boolean indicator that will illuminate if an invalid color is typed in.


Steps to Implement or Execute Code

  1. Run the VI
  2. Select the values of bands 1-3 from drop down menu
  3. the Resistor Value changes when changing the bands colors
  4. If the user doesn't select any color, the output will be (-1) and Invalid Color LED will turn ON 

 Additional Information or References

Top-level VI Code Snippet

Resistor Calculator 2012 NIVerified.png

 

 

**The code for this example has been edited to meet the new Community Example Style Guidelines.**

Chris Van Horn
Applications Engineer

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