Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Limit Switch Basics (http://www.chiefdelphi.com/forums/showthread.php?t=50133)

JWSnedden 27-11-2006 20:21

Limit Switch Basics
 
How do you program limit switches?

RyanN 27-11-2006 20:36

Re: Limit Switch Basics
 
Quote:

Originally Posted by JWSnedden
How do you program limit switches?

I am not the programmmer, but I am the electrician on our team. A limit switch plugs into a digital I/O port on the controller. The switch is closed when the negative is applied (or so I believe and please correct me if I'm wrong). As far as the programming, I have no idea. So it uses the black and white wires of a PWM cable. When the switch is closed, the program is supposed to respond.

JWSnedden 27-11-2006 20:40

Re: Limit Switch Basics
 
Quote:

Originally Posted by RyanN
I am not the programmmer, but I am the electrician on our team. A limit switch plugs into a digital I/O port on the controller. The switch is closed when the negative is applied (or so I believe and please correct me if I'm wrong). As far as the programming, I have no idea. So it uses the black and white wires of a PWM cable. When the switch is closed, the program is supposed to respond.

yes, we knew that. We need to program it. Thank you, though.

Mike Betts 27-11-2006 20:49

Re: Limit Switch Basics
 
JWS,

When the switch is closed, you will read a 0 and then the switch is open, you will read a 1...

Code:

if (rc_dig_in15 == 0) 
  {
  // This will execute when the signal on input 15 is grounded.
  }
  else                 
  {
  // This will execute otherwise (when the switch is open).
  }


Does this make sense?

Mike

JWSnedden 27-11-2006 21:34

Re: Limit Switch Basics
 
Yes Thanks very much!

Stuart 30-11-2006 18:58

Re: Limit Switch Basics
 
#define leftLS rc_dig_in15
#define rightLS rc_dig_in14

if(leftLS == 0)
//the left limit switch is on
//dont turn left any more
if(rightLS == 0)
//the right limit switch is on
// dont turn right any more


//this post made more since before the nevermind

JWSnedden 30-11-2006 19:48

Re: Limit Switch Basics
 
Thanks anyway!


All times are GMT -5. The time now is 01:18.

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