LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Stepper Driver with DAQ and LabVIEW (A4988)

Hello, I want to control an A4988 stepper driver with LabVIEW and a DAQ similar to how you would control it with an Arduino. 

 

I want to create a step index array of T/F in LabVIEW to send out to the driver via "daqmx write". This would essentially just be an array of pulses, TRUE or FALSE, as a digital output of a multifunction DAQ. Then I will put a 4 ms wait inside the loop after each pulse.

 

I just want to know if this is doable?

 

I have attached a screen shot of my LabVIEW code.

Thanks

0 Kudos
Message 1 of 14
(4,072 Views)

Hope its possible to Drive stepper motor using DAQ (Digitial IO).True/False will trigger Clockwise and anticlock wise direction movements.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 14
(4,024 Views)

It is possible, thats how they use it in arduino. The step pin is controlled by True/False pulses, where as direction pin is controlled by true / false

0 Kudos
Message 3 of 14
(2,322 Views)

Hi there,

 

This is a long shot, but would you please be able to show what you have on the left side of the attached photo, as I am carrying out a similar project. Thanks

0 Kudos
Message 4 of 14
(1,261 Views)

Thanks for reaching out. PFA of the code. I use NI-myRIO for my project. So, the code is for myRIO but you should be able to work with the same logic.

 

You can change the speed by changing the elapsed time and the constant.

0 Kudos
Message 5 of 14
(1,241 Views)

Firstly thank you so much, I didn't know if I would get a response after such a period of time. I am working off of LABVIEW 2016, so was wondering, if possible, if you could please attach screenshots of the programme instead, as the vi isn't compatible with my version of LABVIEW. This would be greatly appreciated. Thanks

0 Kudos
Message 6 of 14
(1,228 Views)

hemanthd95_0-1678136733912.png

 

Message 7 of 14
(1,222 Views)

Thank you very much

0 Kudos
Message 8 of 14
(1,205 Views)

Apologies if this is a stupid question, but I couldn't find the digital output box on LABVIEW, so I programmed the DAQ Assistant instead, however, it is saying that the source and sinks are not compatible. I was wondering if anyone came across this problem before, and if so how to fix it. Thanks in advance.

JB005_0-1678184306226.pngJB005_1-1678184335895.png

 

 

0 Kudos
Message 9 of 14
(1,198 Views)

Hi JB,

 


@JB005 wrote:

Apologies if this is a stupid question,


Yes, it is a stupid question! 😄

 

The answer is given in the error explanation: the DAQAssistent expects an array of booleans and you only provide a scalar boolean value!

 

What's the point of that Select node before the DAQAssistent? It's THE classic Rube-Goldberg!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 14
(1,185 Views)