From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Sequence of One-Axis Velocity Moves

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.

    Hardware

  • Motion Control

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This examples has the motor track a sequence of velocity moves that follow a sinusoidal profile.

Description

This example will execute a sequence of moves that will result in a sinusoidal profile. In order to do so, a sinewave is generated with the Sine Pattern.vi and fed to the Load Velocity in RPM VI; the program then starts the motion and goes through a while loop and reads the current velocity, updating the front panel with the current velocity once every second.

This example may be modified to change acceleration or position instead of velocity. To do so, you may change the enum constant that is fed into Set Operation Mode.flx. Instead of a sinewave, different velocity profiles may be set up as well.

Steps to Implement or Execute Code

  1. Select the board ID and Axis
  2. Run the VI
  3. If the motor moves slowly or not at all, check the Acceleration value and adjust it accordingly. The default value might not be suitable for all systems.

Requirements

Software

LabVIEW 8.2 "or compatible"

NI-Motion 8.2 "or compatible". For more information regarding compatibility between LabVIEW and NI-Motion, please view this article.

Hardware

Any controller compatible with the installed version of NI-Motion such as a 7330.

Additional Information or References

VI Snippet

Sequence_One_Axis_Velocity_Moves_Snippet.png

**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit this discussion thread**

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

Contributors