|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Limit Switch Help
Our programming team is having some issues with setting up two limit switches. After button 4 is pressed, our first limit switch, Limit Switch, is supposed to stop our motors. After button 5 is pressed, the second limit switch, Limit Switch 2, is supposed to stop the motors once again.
When we run the code, the upper portion works properly (see picture), but our motors seem to fight each other. Any help or input would be welcomed, and we are open to try everything. Thank you |
|
#2
|
|||
|
|||
|
Re: Limit Switch Help
In case the picture did not show, the link is here:
http://imgur.com/EvqRgHi |
|
#3
|
|||||
|
|||||
|
Re: Limit Switch Help
Here's an example for a Relay. Just replace the Relay with your motor in the sequence you want. Since you are keying off two different limit switches you can also select and pass in the corresponding limit switch name or reference. Last edited by Mark McLeod : 06-11-2014 at 19:42. |
|
#4
|
|||
|
|||
|
Re: Limit Switch Help
Quote:
We went ahead and tried a new chunk of code, and that is not working either. However, it worked better than previously. What went wrong is our "Up" case would not work properly. The motors would not work when this case was triggered, but the "Default" and the "Down" cases worked perfectly. The "Default" case just sets the motor output to 0. Here are pictures of what the code looks like right now. http://imgur.com/yLUmJ8J http://imgur.com/f80i1KW |
|
#5
|
|||
|
|||
|
Re: Limit Switch Help
Alright, so we have figured out our problem. Thank you all for the help
|
|
#6
|
||||
|
||||
|
Re: Limit Switch Help
An additional tip:
Every time you call the reference VI, it will get a joystick reference twice. It's better practice to make a habit to only get references once if you can manage it. It will marginally make you code faster and increase readability. |
|
#7
|
|||
|
|||
|
Re: Limit Switch Help
Quote:
Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|