Example Code

Bouncing Ball 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

Download All

 

Overview
Use an Functional Global Variable to implement equations of uniform acceleration to model a ball thrown from ground level. 


Description
This code uses the equations of uniform acceleration to simulate the behavior of a ball thrown from a point at ground level by using an event driven state machine and an Functional Global Variable. By changing the values of Initial Vertical Velocity, Acceleration due to Gravity, and the Initial Horizontal Velocity, it is possible to visualize the behavior of the ball, which is represented both by a single LED in the above array, and also by the waveform chart.


Requirements

  • LabVIEW 2013 (or compatible)


Steps to Implement or Execute Code

  1. Download the project
  1. Run Main.vi
  2. Trigger ball using 'UP' button on keyboard

 

Additional Information or References
VI Block Diagram

 5-303.png

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

 

 

Regards,

Al C
National Instruments,
Application Engineer

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