Showing results for 
Search instead for 
Did you mean: 

Why my DC motor don't stop?

Go to solution

Hi, im student learning Labview.


I programmed some code by using labview NI 9485.


My intention :

1) I connect to put 24VDC to channel 1 and 2 link by using "boolean on" and disconnect  channel 3 and 4 link by "boolean off".


2) Then motor run clockwise.


3) After specific times go, motor stop cause all boolean go unactivity condition with program stop.


4) I change boolean on and off from 1 and 2 to 3 and 4 channels.


5) Then motor run counter clockwise.


6) After specific times go, motor stop cause all boolean go unactivity condition.


7) Repeat.


But, there is a problem.


When motor finish running clockwise, motor doesn't stop by i power off.


And, after i connect powere on, motor run although i doesn't click labview start button.


So, for fix that problem, i should do click start button as all boolean button off condition with no power.


I think the reason showed up that problem is 9485 relay was not disconnected when motor run after specific time run.


I put my labview code. 


Please give me some tips.


Thank you!

0 Kudos
Message 1 of 7

Please post your LabVIEW code.  You posted a picture of your code, one too small for me to see anything.  Furthermore, I can't click on a picture and expect LabVIEW Help to work, and there is no "Run" button that will let me run the code shown in the picture.


Bob Schor

0 Kudos
Message 2 of 7

@pizzanews wrote:

But, there is a problem.


When motor finish running clockwise, motor doesn't stop by i power off.

You're stopping the task. That doesn't change the output value.


You should at least tell the output to change to off (same way you turned it on).

0 Kudos
Message 3 of 7

I post Labview code for help.


And "Run" button is in the Labview's front panel start button.


I intended, when i clicked start button, that automatically work during specific time i seted in while loop.


After the time, motor stop automatically cause specific time in while loop passed.


However, although labview stop, motor does not stop.


that's my problem.


So, im revising boolean button change from true to false after motor running.

Boolean button changing was successed, but it doesn't stop.

I think reason this is after change from true to false, there is no try to put that boolean signal. 


So i posted two vi, v3 is first try and v4 is second try.


Please help me~

0 Kudos
Message 4 of 7

Thank you sir.


i post my vi.


How can i tell the output to change to off using boolean button transition from true to false??


And, DAQmx task stop VI is not stop sign?

0 Kudos
Message 5 of 7
Accepted by topic author pizzanews

Here's a copy of your V3, with the suggested changes by others above implemented.


The key point is that after waiting (using the Elapsed Time node) I set the values all to False again (to disconnect the relay).

Note that since you have "Auto-start" set to True, you don't need to call Start anywhere. Also, you previously had this after the loop, which wouldn't have been what you wanted (you'd have waited before starting).

You only need to write the values once (each) - the "On" choices before waiting (the loop) and the Off (4*False) after, so neither should be inside the loop.

I also added a very short Wait inside the loop to prevent using 100% CPU.

I replaced the 4*Create Virtual Channel with a single call, and passed all 4 lines into it together. Note that the effect is the same (but much less space is used).


p.s. The collection of shiny badges next to Bob_Schor's forum name at the top of his posts would generally be an indication that he has previously managed to find a Run arrow 😉 He was instead commenting on it not being clickable for a picture (and I appreciated being able to directly look at your VIs, and make suggestions via editing, rather than trying to say "move this here, drag that there, set this true/false, do this/that/the other").

Message 6 of 7

Wow. I finally fix my problems.


Thank you so much!


I thought too complicated to fix it.


I was shocked! And Labview is more fun to learn.


BTW, thank you! 🙂

0 Kudos
Message 7 of 7