Programming manual.
CNC 8070
14.
SUBROUTINES.
Generic user subroutines (G500-G599).
·280·
(REF: 1709)
14.6 Generic user subroutines (G500-G599).
The CNC lets the uses define up to 100 subroutines, common to all channels and that will
be associated with functions G500 through G599, so when the CNC executes one of these
functions, it will execute its associated subroutine. These OEM subroutines may be executed
either in a non-modal or modal way and it also allows resetting the local parameters of the
subroutine.
These subroutines are loaded into RAM memory when they are executed for the first time.
If there is no room in RAM, the CNC will issue a warning and it will execute the subroutine
from the disk. At the end of the program (M30), if no other channel is executing subroutines,
the CNC deletes them from its RAM memory. This way, if a user subroutine is edited or
modified, the CNC assumes the changes the next time it executes it.
When updating the version, only the subroutines supplied by Fagor will be updated when
choosing the third installation level "rename previous version and install completely".
Programming format.
These functions may be programmed anywhere in the program and they don't have to go
alone in the block and allow resetting the local parameters of the subroutine.
Programming format. Executing the subroutine in a non-modal way.
The programming format is the following; the list of arguments appears inside the curly
brackets. To execute the subroutine in a non-modal way, call it using the G code (G500,G501,
etc).
G500
G500 {P0..Pn}
Programming format. Executing the subroutine in a modal way.
The programming format is the following; the list of arguments appears inside the curly
brackets. To execute the subroutine in a modal way, call it using the MG code (MG500,
MG501, etc).
MG500
MG500 {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.
P0..Pn
Optional. Local parameters of the subroutine.
G500
G583 P1=12.3 P2=6
G588 A12.3 B45.3 P10=6
P0..Pn
Optional. Local parameters of the subroutine.
G500
G583 P1=12.3 P2=6
G588 A12.3 B45.3 P10=6
Programming example.
G588 P0=12.3 P5=45.3 K6 P26=34.12 P27=5 D2=0