Flexible NC programming
1.4 Indirect programming
Job planning
1-14 Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
If it is necessary to calculate the G code number, this must be done in a separate parts
program line before the indirect G code programming.
Note
All the valid G codes are shown in the PG, in the "List of G functions/preparatory functions"
section in various groups. See /PG/ Programming Guide Fundamentals, "Tables"
Example
Spindle
S1=300 ;Direct programming
DEF INT SPINU=1
S[SPINU]=300
;Indirect programming:
;Speed 300 rpm for the spindle
whose number is stored in the SPINU variable
(in this example 1).
Feed
FA[U]=300 ;Direct programming
DEF AXIS AXVAR2=U
FA[AXVAR2]=300
;Indirect programming:
;Feedrate for positioning axis whose
address name is stored in the variable of
type AXIS
with the variable name AXVAR2.
Measured value
$AA_MM[X] ;Direct programming
DEF AXIS AXVAR3=X
$AA_MM[AXVAR3]
;Indirect programming:
;Measured value in machine coordinates
for the axis whose name is stored
in variable AXVAR3.
Array element
DEF INT ARRAY1[4,5] ;Direct programming
DEFINE DIM1 AS 4
DEFINE DIM2 AS 5
DEF INT ARRAY[DIM1,DIM2]
ARRAY[DIM1-1,DIM2-1]=5
;Indirect programming:
Array dimensions must be stated
as constant values.
Axis assignment with axis variables
X1=100 X2=200 ;Direct programming
DEF AXIS AXVAR1 AXVAR2
AXVAR1=(X1) AXVAR2=(X2)
AX[AXVAR1]=100 AX[AXVAR2]=200
;Indirect programming:
;Definition of variables
;Assignment of the axis names,
traversal of axes that are stored
in the variables to 100 or 200.
Interpolation parameters with axis
variables
G2 X100 I20 ;Direct programming
DEF AXIS AXVAR1=X
G2 X100 IP[AXVAR1]=20
;Indirect programming:
;Definition and assignment of the axis name
;Indirect programming
of the center
Indirect subroutine call
CALL "L" << R10 ;Call of the program whose number is in R10