Motion Control and Motor Drives

Showing results for 
Search instead for 
Did you mean: 

Controlling 3 stepper motor with labview using usb6218



I´m a new labview user and i want to make a project that involves 3 stepper motor that will be controlled with labview 2010 through an usb-6218.


I would like to know if there is anybody that can help me out with this, like for example: a labview code with some comments so i can understand what are the commands for.


Thank you

0 Kudos
Message 1 of 7



in general controlling motors with a DAQ device is not recommended. Please refer to this thread for some more details about the reasons behind that.


With your USB-6218 controlling 3 steppers is especially discouraged.




For very low performance applications, you could use a counter and a digital output to generate a step/direction signal. The drawback of this method is the fact, that you can't ramp up the output frequency of a counter and if you just turn on the frequency generation, the motor will stall at relatively slow speeds because of inertia.

For your application this method wouldn't work at all, as the 6218 does only provide two counters.


Using digital outputs could be an alternative solution, but this requires hardware timed digital outputs, but the 6218 provides only software timed DOs. Using software timing for controlling steppers is highly discouraged because of very limited I/O rates and high jitter, which also can result in non-deterministic motor stalls. USB connectivity makes this even worse.


The USB-6218 is a good measurement product, but it was really not designed with any type of control application in mind.

For motion control better use NI-Motion boards like the PCI-7334 (see link above) or a system with realtime capabilities like a cRIO-system. Here you can find an overview of motion control systems from NI.


Kind regards,


Jochen Klier

National Instruments

0 Kudos
Message 2 of 7



Well let me start to explain all the project. I have to build a labview code that will connect to the usb-6218. The 6218 will be connected to 3 Ic NJM3517 that will control the motors. My problem is to create a labview code for this project. I tried already to find examples that could give me ideas for this but is being very difficult. I hope with this information you can help me to find a solution for it.


Best Regards


0 Kudos
Message 3 of 7

Hi Rjabreu,


thank you for the additional details but this doesn't change anything to my statement above. The NJM3517 is a drive IC, that requires a step and direction signal as input. For motion control you need a way to generate these signals in a deterministic way. Typically you need to generate a trapezoidal velocity profile and for position control you need to generate a known number of pulses.


For the reasons stated above, the 6218 doesn't provide a good way to generate these signals. As a minimum requirement your hardware needs to be able to generate digital signals with hardware timing. This feature is not available for the 6218.




0 Kudos
Message 4 of 7
HI ,I am a student in china ,persuning a master degree in Zhejiang Sci-Tech University Zhejiang Province in China, my research area is parallel robotics.Now i am studying the labview softmotion for solidworks ,if you gieve me you MSN or MSN that is talking about or communicating the Labview softmotin for solidworks with other ,any reply will be apperciated ,looking forward your reply ,my chinese name is hanayng ,my address is the College of Mechanical Engineering and A utomation in Zhejiang Sci-Tech University 5 Second Avenue,Xiasha Higher Education Zone ,Hangzhou,China,310018
0 Kudos
Message 5 of 7

Hi! My msn contact is

Just add me so we can speak about it.


Best regards

Ricardo Abreu

0 Kudos
Message 6 of 7

Hi! Here is my MSN contact:

Just add me so we can speak about it.


Best regards

Ricardo Abreu


0 Kudos
Message 7 of 7