Exercise: Turn on output led on EL2809 when machine is turned on

More
1 year 9 months ago #318262 by Martin.L
I have spent a lot of time reading the manual but unfortunately I could not put togheter all the pieces to come up with a solution, I'm pretty new to LCNC and I would like to learn by doing, had the idea to turn on an output led on EL2809 when machine is turned on. (have succesfully installed following Rodw guide)

In HalShow I can turn on and off the led my hand with SET CLR buttons, so it works manually.

I found this info : motion.motion-enabled - (bit, out) TRUE when in machine on state.

Also from the manual: 5.2.1.4 net
The command net creates a connection between a signal and one or more pins. If the signal does not
exist net creates the new signal. This replaces the need to use the command newsig. The optional
direction arrows <=, => and <=> make it easier to follow the logic when reading a net command line
and are not used by the net command. The direction arrows must be separated by a space from the
pin names.
Syntax and Examples of net
net signal-name pin-name <optional arrow> <optional second pin-name>
net home-x joint.0.home-sw-in <= parport.0.pin-11-in

So I guess I have to combine these two, but I have no Idea how to do it.
Please Help!

Please Log in to join the conversation.

More
1 year 9 months ago #318271 by Hakan
This is not so much about ethercat but about how to connect pins in hal.
Since you are in halshow, go and find the pins of the EL2809 there. It may be under lcec.0. What number or name depends on your ethercat-conf.xml
Then, when you have the pin name of the output where the led is, you enter in your machine.hal (using the actual pin name)
Code:
net switch-on-led motion.motion-enabled lcec.0.1.output-pin

Please Log in to join the conversation.

More
1 year 9 months ago #318281 by onceloved
You can set it directly via setp, for example, setp lcec.0.1.output-pin 1. For detailed instructions, see this link linuxcnc.org/docs/stable/html/hal/basic-hal.html#sub:hal-setp

Please Log in to join the conversation.

More
1 year 9 months ago #318291 by rodw
for testing, you could also use flood and mist coolant pins so you can turn on and off within linuxcnc. That's what I do.

Please Log in to join the conversation.

More
1 year 9 months ago #318324 by Martin.L
Thank you all, I have missed the HAL basic document somehow, the manual is really tough to start with. I have some questions related,

1 - Whats the difference between "lcec.0.OUT.dout-0" and "lcec.0.OUT.dout-0-invert" they have the same behaviour
2- I also have a EL 1809 that is rated as input current "typically 3 mA (EN 61131-2, type 3)" Is it usually considered a min or max data? can I feed it with more current or should I limit it?

Please Log in to join the conversation.

More
1 year 9 months ago #318385 by Hakan
The invert pin works the opposite way. Set it to 1 and the output goes off.

Maybe this document can shed some light on the 3 mA
download.beckhoff.com/download/document/...DK9222-0909-0008.pdf

Please Log in to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum