Chapter 9 NC Control Function
The "N" command can be used with other commands in the block or it can be used alone in one block.
However, the number used for the "N" command must be unique for each program's motion file (.nc file). If
there is a duplicated Statement Number, an Error will occur.
The Statement Numbers that can be specified with the "N" command range from 0 to 2147483647. If you use a
number exceeding this range, an error is generated. In addition, the number of Statement Numbers that can be
specified in one motion program is up to 1000. If the total number of specified Statement Numbers exceeds 1000,
an error occurs.
The statement numbers ordered commanded with the "N" do not have to be used in numerical order on the
program. That is, the Statement Numbers can be used in random order.
4) Conditional statement (IF)
IF: IF statement
[……]: IF statement‟s conditions
GOTO N_: Specify the Statement Number to be branched
When the condition following“IF”is met, the conditional statement branches to the block with the Statement
Number "N_" specified immediately after it. If the condition is not met, it starts sequentially from the block
immediately below.
For the conditions following “IF”in the conditional statement, you can create them by comparing local variables
with constants, comparing between local variables, and comparing between constants.
In the condition after the "IF" in the conditional statement, variables and constants used in the condition can be
applied up to 2 including variables and constants.
It cannot branch to another motion file (.nc file) or another motion program.
5) Branch instruction (GOTO)
GOTO: Unconditional branch to the block designated as "N_"
N_: Specify the Statement Number to Jump
The branch instruction is the function to branch unconditionally to the block marked with the Statement Number
"N_" that is specified after "GOTO".
It cannot branch to another motion file (.nc file) or to another motion program.