Programming manual.
CNC 8070
SUBROUTINES.
14.
Subroutine execution.
·273·
(REF: 1709)
14.3.5 #MCALL. Modal call to a local or global subroutine.
The #MCALL instruction calls a local or global subroutine. This type of call allows initializing
local parameters of the subroutine. When it is a global subroutine, its whole path may be
defined.
When there are two subroutines, one local and the other one global, with the same name,
the following criteria is applied. If the path has been defined in the call, the CNC will execute
the global subroutine, otherwise, it will execute the local one.
With this type of call, the subroutine becomes modal; i.e. the subroutine remains active in
successive movements and it is repeated at the end of each move. See "Considerations
about the modal character of the subroutine." on page 274.
Programming format.
The programming format is:
#MCALL <path> sub <P0..Pn>
How to set local parameters.
Calling a subroutine allows for the 57 local parameters (P0 to P57) to be initializes. The
values of the parameters must be defined following the call statement and may be defined
in two ways. Both ways of setting local parameters are equivalent and may be combined in
the same block.
• The parameters P0 to P25 can also be defined using the letters from A to Z, so that "A"
is equal to P0, "B" to P1 and so forth and where "Z" is equal to P25.
• The parameters P26 to P52 can also be defined using the letters from "D0= " a "D31=",
so that "D0=" is equal to P26, "D1=" to P27 and so forth and where "D31=" is equal to P57.
Path definition.
Defining the path is optional. If defined, the CNC only looks for the subroutine in that folder;
if not defined, the CNC looks for the subroutine in the default folders. See "Location (path)
of the global subroutines." on page 269.
Turning the subroutine into non-modal.
A subroutine stops being modal with the instruction #MDOFF and in the following cases: See
"14.4 #PATH. Define the location of the global subroutines." on page 277.
• After executing an M02 or an M30 and after a RESET.
• When changing the work plane.
• When programming a probing move (G100).
• When changing the configuration of the axes (#FREE AX, #CALL AX and #SET AX).
• When calling another subroutine (#PCALL, #CALL, L, LL, G180-G189).
• When activating a canned cycle.
path
Optional. Subroutine location.
sub
Name of the subroutine
P0..Pn
Optional. Initializing parameters.
#MCALL C:\Cnc8070\Users\Prg\sub1.nc
#MCALL C:\Cnc8070\Users\sub2.nc A12.3 P10=6
#MCALL Sub3.nc A12.3 F45.3 P10=6
Programming example.
#MCALL subroutine.nc A12.3 F45.3 P10=6 D0=34.12 D1=5 P28=0