How to bind M62-M65 codes to parallel port?

More
05 Dec 2011 05:13 #15390 by Eric_SJ
Hello, I am new to Linux and EMC2 and would like some help in setting up a solder paste dispenser. I found on the following page the ability to drive a pin using M codes:
www.linuxcnc.org/docview/html/gcode_main.html#sec:M62-to-M65
I want to be able to drive the pin on a parallel port, which then triggers my solder paste machine to dispense a drop of solder paste on my PCB.
I have searched the forum for driving output pin / parallel port, but have not come across what I'm looking for. I want to be able to bind these M codes to drive a pin on a parallel port, but I am not sure what steps are needed to configure EMC2 to allow this.
Any and all help is greatly appreciated. Thanks.

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

More
05 Dec 2011 09:34 #15394 by ArcEye
Hi

You need to read the Integrators Manual highlighted in the link you posted and then probably re-read!
It's a steep learning curve.

The pins which are set are motion.digital-in-00 and motion.digital-out-00 (00 to 03 unless extended) for M62-65

These can be linked in your hal file as required ( parport.x.pin-nn-in/out ?)

regards

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

More
05 Dec 2011 09:58 #15395 by Eric_SJ
Thanks for the advice ArcEye.
I'll start reading...and then read it again.

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

More
05 Dec 2011 11:32 #15399 by Rick G
You may also want to look here for an example with using hal...

linuxcnc.org/docs/html/gcode_main.html#sec:M100-to-M199:

Rick G

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

More
08 Dec 2011 06:06 - 08 Dec 2011 06:09 #15467 by Eric_SJ
This did not work for me in the way that I expected or in the way I read in documentation.
Instead of motion.digital-in-00 => parport.1.pin-02-out
I had to create a dummy signal and tie it to motion and my output pin. (Don't have my HAL config file next to be, but this is basically what I had to do.)
newsig foo bit
net foo motion.digital.in-00
net foo parport.1.pin-02-out
This worked exactly like I wanted, outputted the signal to Parallel Port #2, Pin 2.
The documentation says 'newsig' is an obsolete command, but it worked for me, so I'm happy.
Anyone know why the "obsolete" way worked, and the "correct" way didn't?
Last edit: 08 Dec 2011 06:09 by Eric_SJ.

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

More
08 Dec 2011 09:39 - 08 Dec 2011 09:47 #15470 by ArcEye
Eric_SJ wrote:

Instead of motion.digital-in-00 => parport.1.pin-02-out
I had to create a dummy signal and tie it to motion and my output pin. (
Anyone know why the "obsolete" way worked, and the "correct" way didn't?


net foo motion.digital-in-00 => parport.1.pin-02-out

You are tying pins together, think of foo as the wire that connects them

regards
Last edit: 08 Dec 2011 09:47 by ArcEye.

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

More
08 Dec 2011 11:13 - 08 Dec 2011 11:13 #15473 by Eric_SJ
That makes complete sense now, but I don't recall seeing anywhere in the documentation that a "wire" is needed to connect the signal to the pin.

Everything I read said to use a signal and pin (signal => pin), which is what I tried and didn't work.

Hope they update the documentation since people who follow it, like myself, will get stuck.

Thanks. -ArcEye

I am on my way at having a solderpaste dispenser. Did an air run with the mill and it worked flawlessly. Feedback LED lit every time!
Now I just have to add the solder paste hardware to the mix.
Last edit: 08 Dec 2011 11:13 by Eric_SJ.

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

More
08 Dec 2011 11:39 #15475 by ArcEye

.....I don't recall seeing anywhere in the documentation that a "wire is needed ....."


It doesn't say that anywhere, that's just how I think of it to get the syntax right!!!

Glad you have done what you wanted

regards

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

More
08 Dec 2011 12:28 #15476 by Rick G

EMC V2.4 Integrator Manual
6.1.4
Chapter 6. Getting Started
net
The command "net" creates a "connection" between a signal and 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
direction indicators "<= and =>" are only to make it easier for humans to follow the logic and are not
used by the net command.
The syntax and an example:
net <signal-name> <pin-name> <opt-direction> <opt-pin-name>
net both-home-y <= parport.0.pin-11-in


Rick G

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

More
08 Dec 2011 14:35 #15481 by BigJohnT
Eric_SJ wrote:

This did not work for me in the way that I expected or in the way I read in documentation.
Instead of motion.digital-in-00 => parport.1.pin-02-out
I had to create a dummy signal and tie it to motion and my output pin. (Don't have my HAL config file next to be, but this is basically what I had to do.)
newsig foo bit
net foo motion.digital.in-00
net foo parport.1.pin-02-out
This worked exactly like I wanted, outputted the signal to Parallel Port #2, Pin 2.
The documentation says 'newsig' is an obsolete command, but it worked for me, so I'm happy.
Anyone know why the "obsolete" way worked, and the "correct" way didn't?


Any correct way will work. digital in needs to be connected to an input pin from the parallel port. the <=> mean nothing as you will see when you read the basic hal very short chapter.

Have you read this chapter on basic hal?

linuxcnc.org/docview/html/hal_basic_hal.html

John

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

Time to create page: 0.167 seconds
Powered by Kunena Forum