Showing results for 
Search instead for 
Did you mean: 

Motor w/ Time Delay and Direction Change

I am a student using LabView for the first time and working on a code using LabView and myRIO. I am trying to run two different motors, make them run clockwise for 5 sec., stop for 2.5 sec., run counter-clockwise for 5 sec., stop for 2.5 sec. Then make it loop four times before stopping. 


I'm not sure where I am going wrong here, but I think something is wrong with either the input or the case structure. The code runs, but nothing happens and I've checked to see if my motors are properly soldered and plugged in. 

I would appreciate if someone could point me in the right direction!

0 Kudos
Message 1 of 16

You have a LOT of express VI's there we can't look into because you attached a screenshot rather than a VI.


What kinds of motors are these?  You have several different digital outputs you are wiring True constants to, but I never see you wiring a false to them.  Your case structure is always True because of the constant, and we can't see the false case.

0 Kudos
Message 2 of 16

Sorry, attached here is the VI!

0 Kudos
Message 3 of 16

I've added the VI file in the thread. Didn't think properly about what wasn't being seen due to it being just a screenshot. 

These are two brushless DC motors. I didn't wire a false because I wasn't sure where I would put one, and I didn't know what my false case would be. 

0 Kudos
Message 4 of 16
I've added the VI file to the thread - didn't think properly about what wasn't being seen with just a screenshot! I am using two DC motors, and did not wire a false because I didn't know what my false case would be or where I'd put it.
0 Kudos
Message 5 of 16

What do those digital outputs do?  Do they drive a relay that turns on the motors in a particular direction?  How do you change to the other direction?  How do you stop the motor so you can change to the other direction?


Before you get into a more complicated VI, have you been able to do a couple basic steps in LabVIEW to be able to turn on and off one motor?  Ar eyou sure your motor is getting voltage?

0 Kudos
Message 6 of 16
I thought the digital outputs would turn on the motor. The second set of digital ouputs I had intended to use to make the motors turn in another direction but I'm probably wrong here. I haven't ever written a VI before so I don't really know how to turn on and off a motor.
0 Kudos
Message 7 of 16

Digital outputs don't do anything but put a voltage at that terminal.  They don't turn a motor until you wire things up.  How do you have the motor wired up?  What voltage and current does it draw?  What power supply are you using to power it?  Do you have relays in there?


Think about how you turn on and off a motor if you weren't using LabVIEW.

0 Kudos
Message 8 of 16
Do you mean physically wired? Physicially yes they work, I tried it with an example VI from my professor. However I don't know how to wire it in LabView. There are two motors both of which run 5V.

If i wasn't using LabView, first I would a) input power to motor b) tell the motor to run when it gets input c) tell it what direction to run in.
0 Kudos
Message 9 of 16

Yes.  Physically wired.  How do you connect the motors to your DAQ device?


If the professor's VI works, then what does it look like?  What is different about your setup vs. his setup?

0 Kudos
Message 10 of 16