NCT Group 2000M, 99M manual Custom Macro Call Using M Code, Subprogram Call with M Code

Models: 2000M 99M

1 206
Download 206 pages 27.56 Kb
Page 168
Image 168

20 Custom Macro

20.4 Custom Macro Call Using M Code

Maximum 10 different M codes can be selected by parameters, to which macro calls are initiated. Now the series of instructions

Nn Mm <argument assignment>

have to be typed. Now code M will not be transferred to the PLC, but the macro of the respective program number will be called.

The particular program number to be called by the calling M code has to be selected by parameters. M(9020)=code M calling program O9020

M(9021)=code M calling program O9021

:

M(9029)=code M calling program O9029

Code M can specify invariably a type G65 call (i.e., a non-modal one).

If reference is made again to the same M code in the middle of the macro body, the latter will not call the macro, instead, M code will be transferred to the PLC.

If a user call type G, S, T, A, B, C or some other user call type M is made in the middle of the macro body,

FGMAC=0, not enabled (executed as ordinary M, S, ... G codes) FGMAC=1, enabled, i.e. a new call is generated.

An M code selected by parameters to initiate a macro call may be preceded only by "/" and address N in the block.

A block containing a macro call initiated by M code may include a single M code only. Set of arguments No.1:

A B C D E F G H I J K L P Q R S T U V W X Y Z

Set of arguments No. 2 also can be used with function M.

20.5 Subprogram Call with M Code

Maximum 10 M codes can be selected by parameters, by which subprogram calls can be initiated. Now instead of instruction

Nn Gg Xx Yy M98 Pp can be specified

Nn Gg Xx Yy Mm

Now the selected M code will not be transferred to the PLC, instead, the respective subprogram will be called.

The particular program number to be called by M code can be selected by the following parameters.

M(9000)=code M calling program O9000 M(9001)=code M calling program O9001

:

M(9009)=code M calling program O9009

If reference is made to the same M code again in the subprogram, the latter will not call the subprogram again, but M code will be transferred to the PLC.

If a user call G, S, T, A, B, C or some other user call M is made in the subprogram: FGMAC=0, not enabled (executed as an ordinary codes M, S, ... G) FGMAC=1, enabled, i.e. a new call will be generated.

168

Page 168
Image 168
NCT Group 2000M, 99M manual Custom Macro Call Using M Code, Subprogram Call with M Code