4.11.6 M Code Function


The M code function is described as follows:


Format:

Mmm [ ,Hhh ,Hhh ] Qq xxxx #yyyy zzzz .........


Witin,

mm: All legal M codes except M00/M01/M02/M30/M95/M97/M98/M99.

[,Hhh,Hhh]:The H code in the optional M code.

Q:

The starting number of the macro variable used to substitute the input value.

(followed by digits or macro variables, and can only have both, and there are no other instructions, and up to 10 groups of numbers or macro variables can be set.)

xxxx, zzzz(number):insert value.

#yyyy(Macro variable value):insert value.


In the function of M code function, the M code defined by the macro variable input value is substituted into the defined M code to execute the operation. The M code definition is written as the PLC executes.


When this M code instruction is executed, the system substitutes xxxx into #q in sequence, the value of the macro variable yyyy is substituted into #(q+1), zzzz is substituted into #(q+2), and so on, for PLC operation.


For detailed usage and contents, please refer to M97: Internal Subprogram Call.


Note:

The input values ​​can be separated by a comma (,), which means that the input values ​​can be separated by spaces or commas (,), such as:

Mmm [ ,Hhh ,Hhh ] Qq xxxx,#yyyy,zzzz, .........