We are having some trouble coding some relays. We want to use window motors attached to spike relays to raise and lower an arm (kinda like the front of a tractor) to lift the totes for this year"s game. We need help coding the relays and motors, and assigning buttons to stuff. Do you need to use some comparison code or something? We are total rookies, and some help or links to other forum posts with the same issue would be greatly appreciated. I can post pictures of stuff we have tried / are trying, if you guys think it will help.
Can you tell us more what how you expect this to be controlled?
Will you have two positions (up and down)? three? Or do you want to be able to stop anywhere in the path?
Do you want a button that drives it up and one that drives it down? Do you want a button that sends it to the top most position and one for the bottom position?
How will you know when it is at the end of the movement? are the limit switches?
We’re trying to keep it simple- hold a button to raise, hold a button to lower. I guess that would be 2 positions. We want it to stop whenever the driver stops pressing the button. The arm is powered by a winch/pulley type of deal, so as of right now it’s up to our driver to not raise the arm too high and bog down the motor (unless we can figure out a way to limit the motor’s rotation. We plan on doing stuff like that once we have the main robot working how we like it.)
What language? Labview, C++, or java?
I’d presume LabView, since it’s on the LabView forum.
This thread probably has what you want. See post #6 for sample code.
Here’s our code- it’s giving us an error in TeleOp saying that the Relay DevRef needs to be wired. Also, we fixed the Set/Get issue
You see your Relay RefNum Get? Yeah, what you have there is actually a Relay RefNum Set. Replace it with the right one and that error will be gone.
We got it mostly fixed. Still an error on the second comparison. I’ll post a picture when I get home.