PMAC Product Guide The CALL command is similar, except that it can jump to another motion program. Examples: GOSUB300 ; jumps to N300 of this program, to jump back on RETURN GOSUB8743 ; jumps to N8743 of this program, to jump back on RETURN GOSUB(P17) ; jumps to the line label of this program whose number matches the current value of P17, to jump back on return GOTO Function : Unconditional jump without return Type : Motion program (PROG only) Syntax : GOTO{data} where {data} is an integer constant or expression with a value from 0 to 99,999. This command causes the motion program execution to jump to the line label ( N or O ) specified in {data} , with no jump back.
If {data} is a constant, the path to the label 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, then continues (if necessary) from the top of the program down. A variable GOTO command permits the equivalent structure to the CASE statement found in many high- level languages (see Examples, below). If the specified line label is not found, the program will stop and the coordinate system’s run time error bit will be set. Note:
Modern philosophies of the proper structuring of computer code strongly discourage the use of GOTO because of its tendency to make code undecipherable. Examples: GOTO750 GOTO35000 GOTO1 GOTO(50+P1) N51 P10=50*SIN(P11) GOTO60 N52 P10=50*COS(P11) GOTO60 N53 P10=50*TAN(P11) N60 X(P10) HOME Function : Programmed homing Type : Motion program Syntax : HOME {constant} [,{constant}...] HOME {constant}..{constant} [,{constant}..{constant}...] HM {constant} [,{constant}...] HM {constant}..{constant} [,{constant}..{constant}...] where {constant} is an integer from 1 to 8 representing a motor number. This causes the specified motors to go through their homing search cycles.
Note that the motors must be specified directly by number, not the matching axis letters. Specify which motors are to be homed. All Buffer Commands 217