What's new
What's new

how to use the GOTO command to GOTO A variable

mattjames74

Plastic
Joined
Mar 1, 2019
How can I use the GOTO command to go to a variable instead of a N number. Or can I put a variable after the N number for the GOTO command to see?
 
How can I use the GOTO command to go to a variable instead of a N number. Or can I put a variable after the N number for the GOTO command to see?
Hello Matt,
You don't give the make of the control involved, however, most follow the same syntax and rules as Fanuc.

The GOTO Command us used to branch to a specified Sequence Number in the range 1 to 99999. The specification of the Sequence Number can be made with an explicit number, an expression, or a Variable. However, Sequence Numbers can't be referenced using variables. For example, the following is not allowed:

N#10

But a Sequence Number can be specified with a GOTO Command using a Variable in the following manner:

GOTO#10

If #10 had the value 20, then the above GOTO Command would have the program branch to N20. But it can't be used to Branch to an actual Variable, only a Sequence Number.

Regards,

Bill
 








 
Back
Top