website logo
💾Software
Hardware
Navigate through spaces
💾Software
Hardware
⌘K
Untitled doc
Safety
I/O Control
Untitled doc
Inverting I/O
Using Spindle Control
Using AUX outputs
Using AUX inputs
Using other inputs
Using 0-10V outputs
Using PWM outputs
How to...
Config toolchain area guard (TCA)
How to use...
Loading and executing a job
Navigating the application
Starting the application
G-code
Introduction
Supported G-code
Supported M-codes
Macro programming
Introduction
M Function override and user M-functions
I/O Operations
Examples
Interpreter
Keyboard shortcuts
Camera support
Untitled doc
G-code
System-parameters/variables
Untitled doc
Untitled doc
Software installation
Interface
Keyboard shortcuts
Docs powered by archbee 
3min

M Function override and user M-functions

The system allows M functions in the range of M1..M999. This means there are many un-used M-functions. The user can create his own M-Function by creating a subroutine for it in the macro.cnc.

For example:

sub m100 ;Do your stuff here Msg “my M100” M54 p1; switch on AUX output 1 endsub

Parameters

So if the g-code file performs M100, the subroutine will be called. Also parameters in the form M100 S100 is possible. In the subroutine the parameter can be accessed using #19 (#1 .. #26 accesses parameter A..Z), S is number 19 in the alphabet. This creates further possibilities: It is possible to override existing M functions as well. Suppose you want additional function for M3 which is spindle on standard. If you spindle has an output speed-reached, you can wait for it like this:



sub m3 msg "my customized m3" m3 s#19 ;The real m3, inside sub routine this m3 will execute the real m3 m56 P1 L2 Q60 ; Wait max. 1 minute for input 1 to become low endsub

When you are inside your m3 subroutine and perform an m3, then the subroutine is not called, but the default m3 is called instead. There are some limitations on using the M Function override:

• There must be nothing else on the G-code line as the M-Function, e.g.

N2000 M3 S1000 is OK.

N2000 M3 M8 G1X100 is NOT OK!

• The user parameters 1-26 will be used as parameter and will be overwritten when M-Function subroutines are used. Take this into account and do not use #1..#26 in your program if you use this functionality. Variable 1-26 match with the letter of the alphabet, #1 will get the value of parameter A, #26 will get the value of parameter Z.

Updated 25 Mar 2022
Did this page help you?
Yes
No
UP NEXT
I/O Operations
Docs powered by archbee 
TABLE OF CONTENTS
Parameters