To download NI software, including the products shown below, visit ni.com/downloads.
Overview
An example piece of code which allows a demonstration of the net forces and acceleration acting on a block resting on an inclined plane.
Description
The Front Panel of the VI allows the user to change the properties of the VI:
The user can then Play the VI and watch the net forces act on the block, if the downhill force is greater than the frictional forces it will accelerate downhill. The user can also adjust the values as the block is moving or refresh the demo.
Coding concepts
An Event Based State Machine architecture is implemented in the code with an Event Structure which transition to different code based on the user input. The VI uses the Picture Functions from the Picture Control Toolkit to draw lines with the start and end points calculated using trigonometric functions based on the angle of incline and the block velocity/position. These Picture Functions can be seen in the individual SubVIs which are used to draw the incline, block and arrows.
Requirement
Steps to Implement or Execute Code
Additional Information or References
Block Diagram
**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.