
1.CONTROLLED AXIS NC FUNCTION B-63942EN/02
- 40 -
1.10.2 AXNUM Function
By using AXNUM[ ], an axis number can be obtained.
Format
AXNUM[ (Axis name) ];
Explanation
If an invalid (Axis name) is specified, an alarm is issued.
Example)
Suppose that there are three controlled axes and that the first axis
name is "X", the second axis name is "Y", and the third axis
name is "Z".
1. #500=AXNUM[X];
In #500, 1 is stored.
2. #501=AXNUM[Y];
In #501, 2 is stored.
3. #502=AXNUM[Z];
In #502, 3 is stored.
4. #503=AXNUM[A];
An alarm occurs.
Example
Sample program where the first axis name is "X", the second axis
name is "Y", and the third axis name is "Z1"
N10 SETVN 500[AXIS1,AXIS2,AXIS3] ;
N20 [#AXIS1]=AXNUM[X] ;
N30 [#AXIS2]=AXNUM[Y] ;
N40 [#AXIS3]=AXNUM[Z1] ;
N50 G92 AX[#AXIS1]=0 AX[#AXIS2]=0 AX[#AXIS3]=0 ;
N60 G01F1000. ;
N70 AX[#AXIS1]=100.0 AX[#AXIS2]=100.0 AX[#AXIS3]=100.0 ;
N80 G02 AX[#AXIS1]=200. 0 AX[#AXIS1]=200.0 R50.0 ;
N90 M02;