firstly you have to configure how many inputs and outputs and which balnks they are on in the galil. read about the CO command. set this number then bn command in galil smarterm.
in mach you have to use vb scripting to
read inputs using : getuserled(*********x)
set outputs using: setuserled(*********x,1) or to turn off replace the 1 with a zero
save this script as a macro and its then called with an M code
inpts/outputs can also be read or set using brains.
where *********x is the number of the led you will be using (which is set in mach plugin)
ie for 8 outputs for example set that block at 3001 then your 8 outputs will be leds 3001 to 3008