Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: krsykes23 on February 26, 2012, 12:52:01 PM

Title: M8 / M9 for Output control
Post by: krsykes23 on February 26, 2012, 12:52:01 PM
I have a second LPT port (LPT2) which is used for an ATC and a couple of other relays.  One of these is
currently hooked up to a Laser Cross Hair system.  I have configured this to...

     Output #3 Port 2 - Pin 16

It works fine when using M8 (on) and M9 (off).  However, I'm confused with the M9, as I am also using this to turn off the ATC air solenoid (turned 'on' with M7).    I have a line of code similar to below....

     G0 Z-47.5    (lowers Z axis to place tool in holder)
     M7              (turns on air solenoid to release the tool)
     G4 P2          (wait for tool to release)
     G0 Z-40       (move up to clear the tool holder)
     M9              (turns off the air solenoid)

I would like to add an M8 before the M7 to turn on the Laser cross hair and then leave on, but the M9 turns it off again!

I suspect VB Code is the answer but trying to stick to G Code?

Keith

    
Title: Re: M8 / M9 for Output control
Post by: BR549 on February 26, 2012, 01:13:06 PM
Simply create your OWN Mcodes to be used in Gcode. Store it in the Mach3/ Macro directory. Then call it when needed via Gcode program.

example:

M100 turn ON output
M101 Turn OFF output

(;-) TP