M code to switch on output 2 in MACH 3 please!?

I am wanting to switch an extraction fan on at the start of a cut and then switch off at the end. Can someone tell me what the M codes are for output 2 and how I can have them put in the GCode automatically please.

Thanks

In script editor, add the following…

If IsOutputActive(OUTPUT2)
DeactivateSignal(OUTPUT2)
else
ActivateSignal(OUTPUT2)
end if

Save the script file as something like M900. Any number will do. Edit your post processor to add the M code where you want it to turn on and then where you want it to turn off.