
B-63943EN-1/02 13.PROGRAM COMMAND
- 1721 -
- AXNUM function
AXNUM[] can be used to obtain an axis number.
AXNUM[(axis-name)];
If the specified (axis-name) is invalid, the alarm (PS0332) occurs.
When the number of control axes is three and the first axis name is
"X", the second axis name is "Y", and the third axis name is "Z"
1. #500=AXNUM[X];
A value of 1 is stored in #500.
2. #501=AXNUM[Y];
A value of 2 is stored in #501.
3. #502=AXNUM[Z];
A value of 3is stored in #502.
4. #503=AXNUM[A];
The alarm (PS0332) occurs.
- Example
Example 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;
Limitation
When the custom macro function is enabled, "AX" and "AXN"
cannot be used as extended axis names and are assumed as AX[] and
AXNUM[], respectively.
Alarm and message
Number Message Description
PS0331 ILLEGAL AXIS NUMBER IN AX[] An illegal value is specified for an AX[] axis number.
PS0332 ILLEGAL AXIS ADDRESS IN
AXNUM[]
An illegal value is specified for an AXNUM[] axis address.