Hi,
two ways I can think of.
First: Pound Variable method
All variables within Mach, and there are thousands of them, are accessible using pound variable notation, #nnnn
I don't offhand know what variable number is for instance associated with Machs Output1, lets say #5677
To cause Ouput1 to go high you would code
#5677=1
To cause it to go low
#5677=0
The only real difficulty with this method is trying to find a definitive list of assigned pound variables, my understanding
is that as Mach developed some of the variable numbers changed adding to the challenge.
Second: DRO/LED method
In VisualBasic or rather CypressEnable, the VB scripting language of Mach3, there are instructions of the type
setOEMDRO(nnn,<value>)
Where nnn is the DRO number of a variable of Mach3. For instance DRO800 is the x-axis DRO on Machs screen.
Similarly there are instructions of the type
setOEMLED(nnn,<true/false>)
which can be used to set/unset an LED.
Neither of these instructions could be used in a Gcode program as is, the Gcode interpreter has no idea what setOMDRO(...) means.
CE instructions have to be put in a macro that the Gcode interpreter can run.
Lets say for example you wish to turn an output on and you called the macro to do it M150. If you put a line M150
in your Gcode program Mach would execute the instructions contained in M150. M150 might look a bit like this:
setOEMLED(nnn,1)
Given that turning on an output is so simple it doesn't really give you a feel for what can be achieved with macros.
Have a look at Operator/VB Script Editor and open and have a look at some of them, M600 is a doozy!
Mach3 Version 3.x
Macro Programmers Reference Manual
is pretty much essential reading if you wish to write macros and there is some good videos
on the Artsoft site about macros.
Craig