Example Code

Using SW-Timed Digital I/O to Control a Stepper Motor with DAQmx

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

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Overview

This example shows how you can use a Multifunction DAQ device to control a stepper motor from the LabVIEW front panel. 

Description

The program generates a finite number of pulses based on the position changes of a knob on the front panel. The digital high and low pulses for the steps are controlled using sequence structures. The user selected pulse times are inputted into a Wait function that dictates how long each pulse rests in the false or true value of the digital boolean DAQmx Write task.

Requirements

Software

LabVIEW 2009 or compatible

DAQmx 9.1.5 or compatible - Link

Hardware

Compatible Multifunction DAQ device with Digital I/O

Steps to Implement or Execute Code

  1. Specify your desired Stepper Output and Direction Control Line from your Digital DAQ device on the Front Panel
  2. Set the Low and High Time Pulse Characteristics
  3. Run the VI
  4. Manipulate the position of the stepper motor using the Position Knob

Additional Information or References

Stepper Motor FP.PNG

VI Snippet

Stepper Control.png

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

John Passiak

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

Comments
Jeck avla
Member
Member
on

i would like to ask how do u conect the motor to the DAQ??

Contributors