Go to Post A pole is usually made of aluminum or steel pipe. You can get these wherever you get metal. :) As for polls, there's a check box in the "Additional Options" section of the New Thread page that you can click to create said poll. - Chris is me [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 03-03-2009, 16:53
vhcook's Avatar
vhcook vhcook is offline
Reader of Things
AKA: Victoria
FRC #1939 (Kuh-nig-its)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas City, MO
Posts: 546
vhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond repute
Re: Limit Switches

Sure, it's pretty straightforward. First you're going to want to run a PWM cable from the limit switch to a DIO port on your digital sidecar (or decide which port location you're planning to run the cable later).

If you're in the basic framework, you need to put a DIO Open (WPI Library -> IO -> DigitalInput -> DIO IN Open) over on the left where the rest of the opens are. Create constants on the DIO Module and Channel inputs that indicate where you plugged the thing in. Put a DIO Close on the right side of the case statements.

Next, set a DIO In Get in the area of code you want to check (for example, inside the Teleop Execute case of the case statement). Run a wire from the DigitalInputDevRef output of the Open to the same input on the Get so that the code knows which device you're getting the value from. Run a wire from the DigitalInputDevRef output of the Get to the same input on the Close to ensure it exits cleanly.

The "Value" output of the Get is going to be a boolean (true/false) value, that you can run into some logic commands to decide what to do next. For example, you might do a Select (Programming -> Comparison -> Select) that shuts down the motors on True and does what it would have done without the limit switch on False.

We had a couple of the IEC rotary limit switches set up this way using the Normally Closed outputs. That setup returned True when the switch was disconnected from the DIO or when the switch had been triggered. Doing it this way made sure we would fail safe - if the cable was damaged or not plugged in, the motors would not run.

If you're in the advanced framework or you need more help, PM me and I'll be happy to help.
__________________


Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit Switches popnbrown NI LabVIEW 1 10-02-2009 22:39
Limit switches(in C++) beefy1 Programming 3 24-12-2008 15:27
Limit Switches ChrisR_522 Programming 2 25-01-2008 08:04
limit switches stephenthe1 Programming 28 11-05-2005 16:37
Limit switches Team168 Programming 8 10-02-2003 16:22


All times are GMT -5. The time now is 21:47.

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