Go to Post I wouldn’t trade this for anything in this world ;-). - Ken Leung [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-02-2011, 14:51
Emilys75's Avatar
Emilys75 Emilys75 is offline
Registered User
FRC #3711
 
Join Date: Jan 2011
Location: Trout Lake
Posts: 1
Emilys75 is an unknown quantity at this point
Exclamation Limit Switch and Button

I am a programmer for Team 3711 (Trout Lake Mustangs) and want to know if I can have a Limit Switch AND a Button. We have the joystick trigger running a cylinder but want a Limit Switch in series with the trigger. Is that possible to have (switch and trigger)? Most likely this will be two case statements in series. If so, I need help please. P.S. If it is possible, can you post your Vi so I can download it to se what to do?
Thanks, Emily.

Last edited by Emilys75 : 05-02-2011 at 15:03. Reason: Errors
  #2   Spotlight this post!  
Unread 05-02-2011, 16:44
bladetech932's Avatar
bladetech932 bladetech932 is offline
Programmer of awesome
AKA: Jon
FRC #0932 (Circuit Chargers)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Tulsa
Posts: 242
bladetech932 is on a distinguished road
Talking Re: Limit Switch and Button

So you want to run the piston only when the limit switch and button are pressed? could you explain what you want the limit switch and the button to do?

ex. piston fires only when both limit and button are pressed
ex. piston fires when limit is not pressed but button is
__________________
Expect the best, Prepare for the worst
  #3   Spotlight this post!  
Unread 05-02-2011, 21:36
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Limit Switch and Button

It sounds like you want to do this in LabVIEW. You might be interested in the boolean functions such as AND and OR. You can make it so that you need two simultaneous conditions in order to trigger an action.
  #4   Spotlight this post!  
Unread 06-02-2011, 14:37
Bill McKinney Bill McKinney is offline
Registered User
no team
Team Role: Coach
 
Join Date: Nov 2010
Rookie Year: 2010
Location: Trout Lake, WA
Posts: 8
Bill McKinney is an unknown quantity at this point
Re: Limit Switch and Button

Thanks for your responses. Our team is now actually running a FP motor off the x-axis of a second joystick and needs a limit switch so we don't swallow our lead screw (the cylinder got used elsewhere.)
We're going to mess with this now, but I think the and statement is going to be the answer. The trick will be to have the limit switch stop travel in one direction but still make the reverse (retracting) motion of the motor available in order to unswitch the limit switch lever.
  #5   Spotlight this post!  
Unread 06-02-2011, 15:05
bladetech932's Avatar
bladetech932 bladetech932 is offline
Programmer of awesome
AKA: Jon
FRC #0932 (Circuit Chargers)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Tulsa
Posts: 242
bladetech932 is on a distinguished road
Talking Re: Limit Switch and Button

For making the limit switch stop the motor only one way you want the in range and coerce function found in the comparison pallet. This will allow you to set the upper limit or lower limit to zero when the limit switch is pressed depending on what way you don't want the motor to spin (upper is positive and lower is negative direction)
__________________
Expect the best, Prepare for the worst
  #6   Spotlight this post!  
Unread 06-02-2011, 18:58
Bill McKinney Bill McKinney is offline
Registered User
no team
Team Role: Coach
 
Join Date: Nov 2010
Rookie Year: 2010
Location: Trout Lake, WA
Posts: 8
Bill McKinney is an unknown quantity at this point
Re: Limit Switch and Button

After considerable thrashing at the in range and coerce icon I'm unable to set the limits. I see the (apparent) array in the NI example but don't see how to set the constants.
And does this function occur within a true / false case structure controlled by the limit switch DI?
I'm giving up for the duration of the superbowl................
Thanks for any leads, or example code or links to same.
  #7   Spotlight this post!  
Unread 06-02-2011, 19:05
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Limit Switch and Button

One way to do it is to use Select nodes to change the limit for the In Range and Coerce between 1 or -1 and 0 if the switch is pressed.

EDIT: You should make sure to right click on the In Range and Coerce function and check that both "Include Upper Limit" and "Include Lower Limit" are checked.
Attached Thumbnails
Click image for larger version

Name:	LimitSwitch.jpg
Views:	94
Size:	26.6 KB
ID:	10012  
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)

Last edited by Vikesrock : 06-02-2011 at 19:36.
  #8   Spotlight this post!  
Unread 06-02-2011, 19:26
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,856
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Limit Switch and Button

I think your DIO checks are reversed...

The DIO's are True by default and False when a switch is pressed.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #9   Spotlight this post!  
Unread 06-02-2011, 19:30
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Limit Switch and Button

Quote:
Originally Posted by Mark McLeod View Post
I think your DIO checks are reversed...

The DIO's are True by default and False when a switch is pressed.
Whoops! Right you are. I'll fix up the image right now.

EDIT: Image should be fixed now.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)

Last edited by Vikesrock : 06-02-2011 at 19:37.
  #10   Spotlight this post!  
Unread 06-02-2011, 19:41
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,856
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Limit Switch and Button

Well, it would have worked the other way as long as the limit switches were wired to be Normally-Closed.

But it looks good now for Normally-Opened, like most people tend to automatically think of a switch.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #11   Spotlight this post!  
Unread 09-02-2011, 06:21
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Limit Switch and Button

Bill,

If you are only limiting in one direction, you can just wire a constant -1 to the side you aren't limiting of the "In Range and Coerce" VI. No need to check the switch or use the select statement.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
  #12   Spotlight this post!  
Unread 09-02-2011, 12:26
Bill McKinney Bill McKinney is offline
Registered User
no team
Team Role: Coach
 
Join Date: Nov 2010
Rookie Year: 2010
Location: Trout Lake, WA
Posts: 8
Bill McKinney is an unknown quantity at this point
Re: Limit Switch and Button

Hah, that's classic. We're just about to get the second limit switch hooked up and were starting to figure how to get both in one section of code. You solved that problem of course at the same time you pointed out my extra work on the last one. I should have noticed the two different switches in your example.....
I think I'll delete my other post with the misleading code.
Thanks again, nice glacier point pic by the way.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 23:34.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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