09-06-2017 06:47 AM
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
Solved! Go to Solution.
09-06-2017 07:25 AM
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
09-06-2017 07:48 AM
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!
09-06-2017 12:28 PM
What do you mean by "interchangeably"?
09-06-2017 01:14 PM
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.
09-07-2017 01:54 AM
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
09-07-2017 05:09 AM
@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.
09-07-2017 05:11 AM
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. 😉
09-11-2017 04:12 AM
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
09-11-2017 04:44 AM
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.) 😉