Hi Juanjo-Lasing,
The GCode Interpreter has a method of invoking generalized "Actions". Actions can be invoked from MCodes, S Words, User Defined Buttons, or Special Actions. The Actions performed can be various operations such as changing the states of one or two I/O Bits, writing a Speed value to a DAC, Invoking a User C Program in KFLOP, Invoking a PC Program, Application Callback, or Executing GCode.
The link you provided to MCODE_TYPE defines what type of Action to perform. It is not related to an MCode Number. An Action consists of an MCODE_TYPE and several parameters (numeric and a string). The number and purpose of the parameters vary depending on the MCODE_TYPE.
The Interpreter allows you to configure about 30 MCodes to perform Actions. Several MCodes such as M0 (stop) and M30 (stop/rewind) have Interpreter functionality, but can also perform an additional Action. 20 MCodes (100-119) are for User use.
The Interpreter's 'S' word can also invoke an Action.
The KMotionCNC Application also uses Actions assigned to custom User Buttons and to "Special Actions" that are executed on operations such as Application Startup. All Actions are stored in an array and referenced by the index into the array (not necessarily the MCode number). See the chart in the wiki
here.
You might read how KMotionCNC allows the MCode Actions to be configured in its Tool Setup. See
here and
here.
From .NET you can configure the Action Array using the
KM_Interpreter.SetMcodeAction Method
After the Action Array in the Interpreter is configured any Interpreted MCode (or S) will perform the configured Action.
Note that MCodes can also set GCode Parameters (PQR words) into KFLOP persist variables. This is described
here.
This
Yahoo Thread may also help.
HTH