My team is using the Victor motor for our arm. We did the programmation, but it doesn’t work. We added the same vi’s (Begin, Set, Get, Set Refnum, Get Refnum and Close). And also, what is the signification of the red light on the Victor?
Here’s three print screen about our arm with Victor with LabView:
Actually if no buttons are pressed you will have a race condition and it is impossible to determine if the output will be 0 or 50% reverse.
I recommend you place one case structure inside the other and explicitly define what you want to happen in all 4 possible conditions (Only #1 pressed, Only #5 pressed, Both pressed, neither pressed). If you need help understanding how to nest the case structure or how it works with one inside the other feel free to post here and I will explain further.
EDIT: Also without seeing the “true” Case for the case structures we can’t tell what will happen when you actually do push the buttons. If you want to continue down this path and not nest them as I suggest above we’ll need to see the “True” cases and we’ll also need a description of what you want the code to do (IE. Power the motor at 50% reverse when button #1 is pressed and power at 50% forward when button #5 is pressed)
Actually what, we would like to do is basically simple.
We first use a spike to control our electric motor, but it appeared we are not allowed to use a spike.:ahh:
So we putted a victor instead. So all our code has to change.
After we wrote our code, we couldn’t control our motor anymore. We don’t know if there is something wrong about the code, or it’s the component itself that doesn’t work well.
Now as far as our code above is concerned, we wanted to control our victor with two buttons.
One will make the current go through in a direction(button 1), and the other one will reverse the current (button 5). To be more specific, button 1 will be used to foward our vitor whenever we’ll press it and button 5 will reverse it anytime also.
The true condition does the opposite of the false meaning button 1 sets the motor to 0.5 and button 5 sets the motor to 0.
Seriously we don’t understand what’s wrong with the code. We tried a couple of solutions but it didn’t work. We need your HELP on this. This is our rookie year and we would like to impress our school and the community.
Quick unrelated question. What physical motor are you using on the robot that was wired up to the Spike? There’s a pretty short list of motors that you’re not allowed to wire to a Spike, I’d like to make sure we’re not making this change for no reason.
Just checking on the legality of things. Moving on…
Your code there looks good and should work. I think I see the problem, and we should have all noticed it earlier, but it’s a tricky one to catch. I think you’re accidentally using different names for your motor reference.
In the screen where you’re closing the reference and the screen where you’re controlling the motor, it looks like you’re calling it [Bras Robot]
In the screen where you’re opening the reference to the motor, it looks like you’re calling it [Bras Robot ] with an extra space at the end. That extra space DOES matter and it means you’re saving the motor reference to a different name that you’re accessing it with.
So, I think if you double check all your references to [Bras Robot] and make sure they’re all exactly the same, things should work for you. Copy / Paste works well here. You might also want to double check this for anything else in your program you’re having problems with.
In case that doesn’t fix things, what does the LED on the Victor look like when your robot is on and in teleop? Is it blinking yellow or is it a solid color? Does it change colors when you press buttons 1 and 5?