omron — GOSUB

PMAC Product Guide Note: If only non-feedrate axes are commanded to move in a feedrate-specified move, PMAC will compute the vector distance, and so the move time as zero and will attempt to do the move in the acceleration time (TA or 2*TS), possibly limited by the maximum velocity and/or acceleration parameters for the motor(s). This will probably be much faster than intended. The FRAX command without arguments causes all axes in the coordinate system to be feedrate axes in subsequent move commands. The FRAX command with arguments causes the specified axes to be feedrate axes, and all axes not specified to be non-feedrate axes, in subsequent move commands.

If no motion program buffer is open when this command is sent to PMAC, it will be executed as an on- line coordinate system command. Examples: For a three-axis cartesian system scaled in millimeters: FRAX(X,Y) INC X30 Y40 Z10 F100 Vector distance is SQRT(30 2 + 40 2 ) = 50 mm. At a speed of 100 mm/sec, move time (unblended) is 0.5 sec. X-axis speed is 30/0.5 = 60 mm/sec; Y-axis speed is 40/0.5 = 80 mm/sec; Z-axis speed is 10/0.5 = 20 mm/sec. Z20 Vector distance is SQRT(0 2 +0 2 ) = 0 mm. Move time (unblended) is 0.0 sec, so Z-axis speed is limited only by acceleration parameters. FRAX(X,Y,Z) INC X-30 Y-40 Z120 F65 Vector distance is SQRT(-30 2 + -40 2 +120 2 ) = 130 mm.

Move time is 130/65 = 2.0 sec. X-axis speed is 30/2.0 = 15 mm/sec; Y-axis speed is 40/2.0 = 20 mm/sec; Z-axis speed is 120/2.0 = 60 mm/sec. GOSUB Function : Unconditional jump with return Type : Motion program (PROG only) Syntax : GOSUB{data} where {data} is a constant or expression representing the line label to jump to. {letter} (optional) is any letter character except N or O. This command causes the motion program execution to jump to the line label ( N or O ) of the same motion program specified in {data} with a jump back to the commands immediately following the GOSUB upon encountering the next RETURN command.

If {data} is a constant, the path to the subroutine will have been linked before program run time, so the jump is very quick. If {data} is a variable expression, it must be evaluated at run time and the appropriate label then searched for. The search starts downward in the program to the end, and then continues (if necessary) from the top of the program down. A variable GOSUB command permits the equivalent structure to the CASE statement found in many high- level languages. If the specified line label is not found, the GOSUB command will be ignored and the program will continue as if the command had not occurred. 216 Buffer Commands