![]() |
Limit Switch problem
We're trying to program a digital input with a limit switch. How do we set the if statement?
This is what we have so far Code:
if(Clamplimit -> Get() > 0) |
Re: Limit Switch problem
How you write the if statement depends on what you want it to do.
What do you want it to do? |
Re: Limit Switch problem
We have a claw connected to solenoids 7 and 6. We want the limit switch to close the claw when it's hit
|
Re: Limit Switch problem
You just need to turn
Code:
if (limit_switch_active)Replace limit_switch_active with whatever it takes to read your limit switch. That's something like Clamplimit->Get(), right? Replace the activate_solenoid_# with whatever it takes to put your solenoids in the desired state. I don't know how you've instantiated your limit switch or your solenoids, and I don't know how they are wired, so I can't give you working code to copy and paste. I assume you'll want some way to open the claw later, right? |
Re: Limit Switch problem
This is how we have it set up
Code:
DigitalInput *Clamplimit; //Limit Switch for clamp |
Re: Limit Switch problem
No, it needs to be:
Code:
DigitalInput *Clamplimit; //Limit Switch for clamp |
| All times are GMT -5. The time now is 02:24. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi