Page 1 of 1

Modify M3, M4 & M5 Macros

Posted: Fri May 01, 2015 2:57 pm
by andy_con
Hi there,
I need to modify the M3, M4 and M5 macros in MachStdMill, but can't find out how to do so.

The CNC mill it is driving has a spindle reverse relay which is connected to Parallel port 1, Pin 16. This is defined at output3 in Mach. When the relay is low, the spindle rotates CW. When this relay is pulled high/activated, the spindle rotates CCW (simple motor change over relay).

However there is also a "spindle go relay" which needs to be active to run the spindle motor.
This is set on Parallel port 1, Pin one, mapped to Output1.

For CW, Output1 needs to be high (Output 3 low)
For CCW, Output1 + output 3 need to be high.

When M5'ing,output1 + output3 should be low.

For years I have been using just the Output1 to control the spindle CW, and works well, however I need to add control of the reverse relay to make the spindle reverse correctly.

How do I modify the macros in Machstd mill to do this correctly?
Any pointers? I had a look in the manual, however it states modifying the M-macros is specifically not included.

Thanks,
Andy

Re: Modify M3, M4 & M5 Macros

Posted: Sat May 02, 2015 9:25 am
by DaveCVI
Hi,
With MSM, instead of modifying the M-code script directly, you create a separate script that contains the customizations that you want for the M3/4/5 actions. MSM will call your customization script while executing the M3//4/5 M-codes.
All you need to do is write the code you and then out the script in the correct directory.

Please see section 15.9 of the MSM ill user manual for details.

Dave