Example Code

Calculating BMI Using Case Structures 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

Overview
This VI shows how to use case structures to calculate BMI.


Description

This code taks in a patient's height and weight, then, using case structures, outputs the patient's status.  Depending on the BMI, the patient is either underweight, normal, or overweight.


Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Enter the patient's weight into "Patient's Weight."
  2. Enter the patient's height into "Patient's Height."
  3. The Status and the BMI for the patient will be output in the "Output Information" section.
  4. The program will run continuously and patient values can be entered until the stop button is pressed.

 

Additional Information or References

VI Snippet

354.png

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

 

 

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