Go to Post The game hint is never late. Nor is it early. It arrives precisely when it means to. - Oblarg [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-02-2015, 08:04
eneubec1 eneubec1 is offline
Registered User
FRC #5090 (Torque-Nados)
Team Role: Coach
 
Join Date: Nov 2013
Rookie Year: 2014
Location: michigan
Posts: 37
eneubec1 is an unknown quantity at this point
Help with debugging read of DIO

We have some code that we think should work but when we probe it on the test bench the DIO logic never changes when the limit switch is pressed. We confirmed the wiring is proper with a volt meter.

We are trying to read to limit switches to determine when our elevator has reached the top and the bottom so we can turn off the elevator motor. This is our FIRST experience with using limit switches and think we are missing something basic. The Begin.VI also has a simple schematic for how we wired the switch.

Any thoughts?
Do we have to put any code in the periodic task to make reading a DIO work?

I have attached our Begin VI and Teleop VI to this thread for reference.
Attached Files
File Type: vi Begin.vi (20.8 KB, 5 views)
File Type: vi Teleop.vi (22.3 KB, 1 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2015, 08:17
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,695
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: Help with debugging read of DIO

The switch is incorrectly wired.
Switches only use the signal and ground connections on the DIO. No power.
COM by convention connects to ground, but in the case of a switch it won't affect the workings.
The other two connections, NC (Normally Closed) and NO (Normally Open) are just two different choices for the signal that simply read the opposite of each other.

Remove the wire to NC.

As to the code, it seems to me that your boolean logic is reversed, because of the NO choice.
Try running in debug and probe the output of the DIO Get to see what value NO (Normally Open) returns.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 06-02-2015 at 08:32.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2015, 14:17
eneubec1 eneubec1 is offline
Registered User
FRC #5090 (Torque-Nados)
Team Role: Coach
 
Join Date: Nov 2013
Rookie Year: 2014
Location: michigan
Posts: 37
eneubec1 is an unknown quantity at this point
Re: Help with debugging read of DIO

Thanks Mark.
I'll try that when we get to the shop today.
I was working under the impression that a limit switch needs to go "high" to 5V and Low "GND".
Wiring the switch so the read can determine if the circuit is closed sounds like all we need to do. (It was also the reason why the logic would looks backwards).

Your explanation was exactly what I needed.

Thanks
-Ed
Reply With Quote
Reply


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 09:27.

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