John Thornton wrote:

>On 10 Dec 2008 at 11:19, Stephen Wille Padnos wrote:
>  
>
>>John Thornton wrote:
>>    
>>
>>>A switch will make the in-not True when closed and False when open
>>>and the in will be False when closed and True when open.
>>>      
>>>
>>That's not necessarily true.  Whether the switch is NC or NO makes
>>no 
>>difference.  It's whether the switch is normally pulled high,
>>    
>>
>I'm guessing your speaking of the input pin on the parallel port not the 
>switch as the switch 
>only opens and closes... 
>  
>
Yes.  The switch should have two states, open or closed.

>>normally 
>>pulled low, or normally left floating (which is equivalent to pulled
>>high in most cases).  
>>    
>>
>"A +5V level on the parallel port pin will make the -in pin 1 and the -in-not 
>pin 0, 
>a 0V level on the parallel port pin will make -in 0 and -in-not 1."
>
>The above seems to be the most accurate description but would a newbee 
>understand?
>  
>
I don't know :)

>  The driver knows that some of the
>  
>
>>pins 
>>are inverted in hardware, and inverts those before setting the state
>>of 
>>the HAL pins.
>>    
>>
>I didn't even think of the wiring issue. 
>The pin could pulled low or high when the switch closes???
>and only floating when the switch is open???
>  
>
Generally, you don't want the pin to float at all.  Floating pins are 
much more susceptible to electrical noise.

Here's an ACSII art circuit diagram:
+5V ----  10k resistor ----  parport_pin  ---- 50 ohm ---- switch  ---  
ground

In the "circuit" above, the input will be "1" when the switch is open 
and "0" when the switch is closed.

You can swap the +5 and ground ends:
ground ---- 10k resistor ---- parport_pin ---- 50 ohm ---- switch ---- +5V

and the input would then be "0" when the switch is open and "1" when closed.

Which is "normal" (ie, NC or NO) makes no difference as far as the pin 
value in HAL.  The *meaning* of the switch being open or closed is 
dependent on how it's attached to the machine and what it's used for, 
and that's what drives the decision to connect "-in" or "-in-not" to a 
particular function.

>In most cases when you close your switch would you put +5vdc 
>on the parallel port pin or 0vdc?
>  
>
>>(Not being pedantic here - I just don't want people to see this and
>>assume that something is wrong with EMC2 because their input isn't
>>working the way this describes)
>>
>>- Steve
>>    
>>
>Steve makes John look up the definition of pedantic :)
>  
>
Heh :)

- Steve


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to