Example Code

Weight and Distance Converter

Code and Documents

Attachment

Download All

Overview
This example VI shows how to use nested case structures to realize the weight and distance converter. .

 


Description
This VI uses nested case structures to select what type of conversion to use and what units to convert. Three enumerated controls are used in this VI, one for selecting Weight or Distance, the other two are used for choosing the units to convert. The mathematics use a single multiplication which times the conversion value by a constant that represents the conversion of a single unit.

The result is created by a Format Into String VI, which formats and appends the Convert To enumerate text to the resulting double numeric holding the converted value.

 


Requirements

  • LabVIEW 2012 (or compatible)
  • Windows Media Player


Steps to Implement or Execute Code

  1. Unzip the attached folder to your computer
  2. Open the project "Converter 2012 NIVerified.lvproj"
  3. Open the VI "Conversion 2012 NIVerified.vi"
  4. Run the program

 

Additional Information or References
VI Block Diagram of "Conversion 2012 NIVerified.vi"

Block Diagram.PNG 

 

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


   
   
Ben B.

Applications Engineer
National Instruments UK & Ireland

"I've looked into the reset button, the science is impossible!"

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

Comments
jordankuehn
Member
Member
on

This does not appear to be a state machine.

The Colex Group
Lead Software Engineer
Certified LabVIEW Developer