|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
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. Last edited by Mark McLeod : 06-02-2015 at 08:32. |
|
#2
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|