LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving 4 motors at once by distance

I created this test program to try to turn my robot measured by distance so we can find what distance makes it turn a specific degree. Thing is, it will only move 2 of them at once. I have 4 motors, 2 on each side. Each pair is moved at a distance and power that is opposite the other pair in order for it to turn, but when testing, it will move only one of the pairs and then the other pair. It does not move all 4 motors at once. What did I do worng? How do i fix this?

0 Kudos
Message 1 of 2
(2,001 Views)

Because that is what you are telling it to do.

 

Remember that LV is a dataflow language. On of the implications is that a VI will begin executing when all its inputs have data on them. The other implication is that a VI will only output data when it finishes executing.

 

Now look at the first two VIs in your diagram. The first one (Motor 5 and 6) one have one input so it begins executing immediately. The second VI (Motors 3 and 4) has two inputs, one of which is coming from the first VI. As a result, the second VI doesn't have all the data it needs to start until after the first VI finishes.

 

Likewise, the third icon (the 1st long skinny one) has an input coming from the second VI and the fourth icon (the other long skinny one) only runs after the third one finishes.

 

Try breaking it up into two parallel paths: one that handles motors 5 and 6, and one that handles motors 3 and 4.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 2
(1,969 Views)