An example piece of code which allows a demonstration of the net forces and acceleration acting on a block resting on an inclined plane.
The Front Panel of the VI allows the user to change the properties of the VI:
Angle of incline
Mass of block
Coefficient of friction
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.
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.
LabVIEW2013 (or compatible)
Steps to Implement or Execute Code
Open project file
Run the VI
Select the Play Button
Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**