programming

More
29 Sep 2010 20:25 #4422 by occesar_0
programming was created by occesar_0
hi

Excuse me, I was thinking...

what kind of commands in a program can enable or disable a pin in my port?

I want to put some valves, and I want to on and off, when needed, but through a emc2 program, is it possible?

Please Log in or Create an account to join the conversation.

More
30 Sep 2010 06:58 #4425 by radekB

Please Log in or Create an account to join the conversation.

More
30 Sep 2010 10:28 #4431 by andypugh
Replied by andypugh on topic Re:programming
occesar_0 wrote:

want to put some valves, and I want to on and off, when needed, but through a emc2 program, is it possible?


Yes. You can do it with the Digital Output G-codes:

www.linuxcnc.org/docview/html//gcode_main.html#sec:M62-to-M65

These change the values of HAL pins called motion.digital-out-0 0, motion.digital-out-01 etc.

You then link those to parallel (or other GPIO) port pins with a "net" statement in your HAL file, like this:


net valve1 motion.digital-out-00 => parport.0.pin-10-out

"net" means connect some virtual HAL pins together
"valve1" is a name for the signal. This can be anything you want to call it.
"motion.digital-out-00" is the output (source) virtual pin that the M62 G-code changes the value of.
"=>" is an optional clue for human readers, and is ignored by EMC2
"parport.0.pin-10-out" is an input (receiver) virtual pin in HAL. (It controls an output physical pin at the connector, but to HAL it is an input)

the "net" statement can have one signal name, one output (source) pin name, and any number of input (receiver) pin names.

Please Log in or Create an account to join the conversation.

More
30 Sep 2010 18:45 #4445 by occesar_0
Replied by occesar_0 on topic Re:programming
Yes, that's exactly what I needed, thank you for your time.

Please Log in or Create an account to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum