LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run 2 stepper motors in synchronous or simultaneously

Hello,

I have written a LV code, which has to run 2 stepper motors in synchronous or in simultaneous mode(any of them is fine), but when I execute my code I see 2nd motor is performing it's actions after the 1st motor has completed it's action. I have 2 different boards for controlling 2 different motors. 

 

Help is much appreciated on how to approach this problem.

 

Thank you.LVsync.PNG

0 Kudos
Message 1 of 7
(2,299 Views)

Hi Mak,

 

are those subVIs reentrant?

Does the motor driver allow controlling several motors in parallel?

 

Mind to share more information about your motor and that driver and maybe even attach real code instead of an image of parts of your code?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(2,288 Views)

If you need true synchronous, it has to be supported by your stepper motor controller or driver. Software is not true-synchronous.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 3 of 7
(2,288 Views)

Hi, 

I have attached a zip file with the code, I am not sure if the subVIs is reentrant or not. 

Yes the motor controller allows controlling two different motors in parallel.

0 Kudos
Message 4 of 7
(2,273 Views)

Hi Mak,

 


@Mak_2496 wrote:

I have attached a zip file with the code,


Please use real ZIP format next time, not everybody has 7zip available - "default" ZIP is already supported by Windows (and any other recent OS)…

 

Next time you should also include all those driver VIs as right now all we see are a lot of missing subVIs!

 

Btw. why do you place that driver that deep in a totally wrong folder inside instr.lib?

See this:

Why did you install your VistaMotorsLib inside the Public\Utility folder of the Agilent34401 driver???

 


@Mak_2496 wrote:

I am not sure if the subVIs is reentrant or not.


As long as you don't attach all the subVIs we don't know either!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(2,223 Views)

Hi GerdW,

Ok, I'll use default zip.

 

Sorry, I sent a wrong file. Please take a look at this file.

 

Thank you.

0 Kudos
Message 6 of 7
(2,215 Views)

Hi Mak,

 


@Mak_2496 wrote:

Sorry, I sent a wrong file.


Getting those subVIs doesn't make it better - they are really ugly!

Who wrote them?

 

Example: non of the subVIs I looked at did provide an entry in the context help window…

 

As they use a lot of global variables I don't think they allow to control independent axes/motors in parallel!

 

And no, those subVIs are not reentrant. So they don't allow to execute several instances in parallel…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(2,202 Views)