M-Series Operator’s Manual 4/9/15
M94/M95 - Output On/Off
There are 128 user definable system variable bits that can be used to communicate with the PLC. M94 and M95
are used to request those system variable bits to turn on or off respectively. Requests 1-128 are mapped to the PLC
as system variables SV_M94_M95_1 through SV_M94_M95_128 as shown in the following table:
On Off PLC bit
M94/1 M95/1 SV_M94_M95_1
M94/2 M95/2 SV_M94_M95_2
M94/3 M95/3 SV_M94_M95_3
M94/4 M95/4 SV_M94_M95_4
. . .
. . .
. . .
M94/128
M95/128 SV_M94_M95_128
To use M94 and M95 to control a function external to the servo control, such as an indexer, the input request must
be mapped to one of the PLC outputs in the PLC program. See M94/M95 function usage in the PLC section of the
service manual.
Example:
M94/5/6 ; turns on SV_M94_M95_5 and SV_M94_M95_6.
* NOTE: M94 and M95 will cause prior motion to decelerate to a stop before the requested bits are turned on or
off.
* NOTE: Requests 1-5, 15, and 16 are controlled by the default actions of M3, M4, M5, M6, M7, M8, M9, M10,
M11, and M39. To override or disable a bit used in one of these M codes, define a custom M-function.
M98 - Call Subprogram
M98 calls a user-specified subprogram. A subprogram is a separate program that can be used to perform a certain
operation (e.g. a drilling pattern, contour, etc.) many times throughout a main program.
Calling methods:
M98 Pxxxx Lrrrr
Or
M98 "program.cnc" Lrrrr
where xxxx is the subprogram number (referring to file Oxxxx.cnc, 9100-9999 allowed, leading 0's required in
filename, capital O, lowercase .cnc), rrrr is the repeat value, and "program.cnc" is the name of the subprogram file.
Subprograms are written just like normal programs, with one exception: an M99 should be at the end of the
subprogram. M99 transfers control back to the calling program.
Subprograms can call other subprograms (up to 20 nested levels of calling may be used), Macro M-functions, and
Macros. Macro M-functions and Macros can similarly call subprograms.
Subprograms 9100-9999 can also be embedded into a main program, using O9xxx to designate the beginning of the
subprogram and M99 to end it. The CNC software will read the subprogram and generate a file O9xxx.cnc. The
CNC will not execute the subprogram until it encounters M98 P9xxx.
NOTE: An embedded subprogram definition must be placed before any calls to the subprogram.