Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   HELP: 2 Motors 1 Button in LabVIEW (http://www.chiefdelphi.com/forums/showthread.php?t=126729)

apm4242 18-02-2014 09:14

HELP: 2 Motors 1 Button in LabVIEW
 
2 Attachment(s)
Hi

We are trying to program 2 motors to run in only one direction when a single button is pushed. We have tried a couple of different things with the code but nothing seems to be working. We get no response from either motor.

I have attached pictures of the code we tried. When using buttons 2,3,4, & 5 to run the motors in forward and reverse separately, everything works fine. Any help would be greatly appreciated.

Attachment 16305
Attachment 16306

We used the method outlined by Team 358 here:

notmattlythgoe 18-02-2014 09:38

Re: HELP: 2 Motors 1 Button in LabVIEW
 
The issue is, you have multiple values going into those motors at one time. If button 4 is not pressed and the trigger is pressed you are feeding both a value of 0 and a value of -1 into x motor at the same instant. You'll need to set the code up so you only have one set for each motor being used at any given time.

Invictus3593 18-02-2014 09:41

Re: HELP: 2 Motors 1 Button in LabVIEW
 
In both pictures, you are trying to set each motor to two different values at the same time (having two MotorSet vi's for each motor). This causes the cRio to have to choose between the two values you're sending but it gets indecisive and doesn't cooperate. Condense your code down to only using one MotorSet for both of them and it should work.

Tom Line 18-02-2014 09:56

Re: HELP: 2 Motors 1 Button in LabVIEW
 
It is good LabVIEW programming practice to absolutely never use more than 1 motor set for a given motor that can execute concurrently. It creates race conditions where you have no idea which one is being set.

As the others have said - get rid of your multiple sets and use one for each motor.

apm4242 18-02-2014 10:23

Re: HELP: 2 Motors 1 Button in LabVIEW
 
Thanks for the replies! That makes perfect sense.

Would it work if we wired button 1 to the green wires for buttons 2 and 4? Essentially having 2 buttons going into a single T/F operator.

I don't have the code in front of me or I would just try it.

Alan Anderson 18-02-2014 10:24

Re: HELP: 2 Motors 1 Button in LabVIEW
 
Delete the second pair of Motor Set functions. Use boolean OR functions on the button values to make multiple buttons able to activate the motor. I'm sorry, I don't have LabVIEW handy in order to show you an example.

notmattlythgoe 18-02-2014 10:25

Re: HELP: 2 Motors 1 Button in LabVIEW
 
Quote:

Originally Posted by apm4242 (Post 1345171)
Thanks for the replies! That makes perfect sense.

Would it work if we wired button 1 to the green wires for buttons 2 and 4? Essentially having 2 buttons going into a single T/F operator.

I don't have the code in front of me or I would just try it.

I like Alan's solution.

Mark McLeod 18-02-2014 10:29

Re: HELP: 2 Motors 1 Button in LabVIEW
 
1 Attachment(s)
Just move that bottom Select up and add it as a third Select to each of the previous cascades for the x & y motors.
You can add as many Selects as you have buttons.


All times are GMT -5. The time now is 08:55.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi