LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run two motors interchangeably

Solved!
Go to solution

Hi....

My question could be simple but to me as a beginner in using LabVIEW is not easy, I hope someone would help me.

I would like to run 2 motors, the first one should run for 5 minutes f.x and stops then the second one runs also for 5 minutes then the firs then the second and so on press the stop button.

someone would give me ideas how to make the code!?

thanks in advance

0 Kudos
Message 1 of 10
(4,502 Views)
Solution
Accepted by Hatemaboud

hi

  you can do it by having a flat sequence with two frames(1 motor in each frame and let the motor run for 5 minutes by using wait time) inside a while loop.

 

Note: please go through basics of labview

 

regards

Senthil

0 Kudos
Message 2 of 10
(4,478 Views)

Hi,

 

use a state machine: you need states like "switch motor", "wait" and "exit"…

 

As the state machine also is a fundamental programming scheme I also advise to go through the LabVIEW basics offered by NI!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 10
(4,468 Views)

What do you mean by "interchangeably"?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 10
(4,440 Views)

vsenthil957@gmail.com wrote:

hi

  you can do it by having a flat sequence with two frames(1 motor in each frame and let the motor run for 5 minutes by using wait time) inside a while loop.

 

Note: please go through basics of labview

 

regards

Senthil


I would avoid doing this.  A simple flat sequence structure would be OK for this simple case, but does not scale easily.  As mentioned above, a state machine is the correct answer.

0 Kudos
Message 5 of 10
(4,435 Views)

I mean when I press start the first motor runs for 5 minutes then stops then the second motor runs also for 5 minutes and stops then the first motor again runs for 5 minutes and then the second and continue like this until I press stop 

0 Kudos
Message 6 of 10
(4,418 Views)

@Hatemaboud wrote:

I mean when I press start the first motor runs for 5 minutes then stops then the second motor runs also for 5 minutes and stops then the first motor again runs for 5 minutes and then the second and continue like this until I press stop 


Just wanted to clarify your intention because that's not what "interchangeably" means.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 10
(4,408 Views)

vsenthil957@gmail.com wrote:

hi

  you can do it by having a flat sequence with two frames(1 motor in each frame and let the motor run for 5 minutes by using wait time) inside a while loop.

 

Note: please go through basics of labview

 

regards

Senthil


Sounds like someone else should be going through LabVIEW basics, too.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 10
(4,406 Views)

hi bill

         I know Hatemabound don't have experience in Labview. so i have suggested that way. i am sure that there is better way of doing it using state machine. But i dont want Hatemabound to come back again asking for how to use state machine.

( i do know some basics of Labview I am a CLAD):smileywink:

 

regards

Senthil

 

0 Kudos
Message 9 of 10
(4,376 Views)

vsenthil957@gmail.com wrote:

hi bill

         I know Hatemabound don't have experience in Labview. so i have suggested that way. i am sure that there is better way of doing it using state machine. But i dont want Hatemabound to come back again asking for how to use state machine.

( i do know some basics of Labview I am a CLAD):smileywink:

 

regards

Senthil

 


I see and understand what you are trying to do.  This is how I approach online instruction: If someone has some code in place that is already pretty complicated - even if it exhibits a lot of poor LabVIEW programming technique, I will try to work within that code to offer a solution (as well as point out what could have been coded better); however, if there is little code OR the user is new, I try to nudge them in the right direction by NOT including poor LabVIEW coding technique.  My personal feeling is that you are actually doing a person a disservice by showing them how to do it in a way that will just get them into trouble later on.

I think that maybe we approach things differently here.  You are helping the OP by giving them code from a practical standpoint, while I am also trying to instruct.  I'd rather show them how to do it right and then answer all the questions that go along with it.  You know that old saying about "giving a person a fish", etc., etc.)  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 10 of 10
(4,368 Views)