Ladder connections
01 Apr 2016 21:21 #72532
by kt600v
Ladder connections was created by kt600v
Hello everyone, I´m new at linuxcnc
I would like to ask for a basic example/explantion on how to connect classicladder pins to parallel port pins.
finally , can i use a parallell port pin as input - output (bidireccional)?
many thanks in advance for your reply
I would like to ask for a basic example/explantion on how to connect classicladder pins to parallel port pins.
finally , can i use a parallell port pin as input - output (bidireccional)?
many thanks in advance for your reply
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5008
- Thank you received: 1441
02 Apr 2016 02:07 #72546
by Todd Zuercher
Replied by Todd Zuercher on topic Ladder connections
As far as I know all parallel port pins are one way once the mode for that port is set in hal.
How to connect parallel port pins to Classicladder pins is the same as connecting any other pins in hal. You use a net command. One thing to remember parallel port hal pins naming is a little confusing because the port inputs are hal output pins and the port outputs are hal input pins. Nice and confusing but it makes sense if you think about it long enough. (A signal into the parallel port sends a signal out from the hal pin and vice-versa.)
So for example to connect an input from parallel port pin 10 the hal line might be (such as from a switch)
net ppsignal1 <= parport.0.pin-10-out => classicladder.0.in-00
And to out put a signal from the parallel port. (to trigger a solid state relay)
net ppsignal2 <= classicladder.0.out-00 => parport.0.pin-01-in
A net command in hal connects a "signal" (an arbitrary name you create) to a pin or pins. The signal name is the first thing after the net. If the signal name already exists the pin names after are connected. If it doesn't it is created... A signal can only be connected to one output pin, but can be connected to as man inputs as you like.
This has been a brief hal tutorial, there is a lot more in the manual. Please do your self a favor and read it.
How to connect parallel port pins to Classicladder pins is the same as connecting any other pins in hal. You use a net command. One thing to remember parallel port hal pins naming is a little confusing because the port inputs are hal output pins and the port outputs are hal input pins. Nice and confusing but it makes sense if you think about it long enough. (A signal into the parallel port sends a signal out from the hal pin and vice-versa.)
So for example to connect an input from parallel port pin 10 the hal line might be (such as from a switch)
net ppsignal1 <= parport.0.pin-10-out => classicladder.0.in-00
And to out put a signal from the parallel port. (to trigger a solid state relay)
net ppsignal2 <= classicladder.0.out-00 => parport.0.pin-01-in
A net command in hal connects a "signal" (an arbitrary name you create) to a pin or pins. The signal name is the first thing after the net. If the signal name already exists the pin names after are connected. If it doesn't it is created... A signal can only be connected to one output pin, but can be connected to as man inputs as you like.
This has been a brief hal tutorial, there is a lot more in the manual. Please do your self a favor and read it.
The following user(s) said Thank You: kt600v
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5008
- Thank you received: 1441
02 Apr 2016 02:15 #72548
by Todd Zuercher
Replied by Todd Zuercher on topic Ladder connections
Oh one more thing, Classicladder input and output hal pins are connected to the bit variables in CL like this:
hal pin classicladder.0.in-00 = %I0
hal pin classicladder.0.in-01 = %I1
hal pin classicladder.0.out-00 = %Q0
hal pin classicladder.0.out-01 = %Q1
hal pin classicladder.0.in-00 = %I0
hal pin classicladder.0.in-01 = %I1
hal pin classicladder.0.out-00 = %Q0
hal pin classicladder.0.out-01 = %Q1
The following user(s) said Thank You: kt600v
Please Log in or Create an account to join the conversation.
Time to create page: 0.118 seconds