Hello Guest it is April 20, 2021, 06:45:38 AM

Author Topic: M8 / M9 for Output control  (Read 2150 times)

0 Members and 1 Guest are viewing this topic.

M8 / M9 for Output control
« 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?



Offline BR549

  •  6,952 6,952
    • View Profile
Re: M8 / M9 for Output control
« Reply #1 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.


M100 turn ON output
M101 Turn OFF output

(;-) TP