Reference Manual

Turbo PMAC/PMAC2 Software Reference
Turbo PMAC Program Command Specification 441
With an action statement or statements following on that line, it will execute those statements provided
the condition is true (this syntax is valid in motion programs only). If the condition is false, it will not
execute those statements; it will only execute any statements on a false condition if the line immediately
following begins with ELSE. If the next line does not begin with ELSE, there is an implied ENDIF at the
end of the line.
Note:
When there is an ELSE statement on the motion-program line immediately
following an IF statement with actions on the same line, that ELSE statement is
automatically matched to this IF statement, not to any preceding IF statements
under which this IF statement may be nested.
With no statement following on that line, if the condition is true, Turbo PMAC will execute all
subsequent statements on following lines down to the next ENDIF or ELSE statement (this syntax is valid
in motion and PLC programs). If the condition is false, it will skip to the ENDIF or ELSE statement and
continue execution there.
In a rotary motion program, only the single-line version of the IF statement is permitted. No ELSE or
ENDIF statements are allowed.
In a PLC program, compound conditions can be extended onto multiple program lines with subsequent
AND and OR statements.
There is no limit on nesting of IF conditions and WHILE loops (other than total buffer size) in fixed
motion and PLC programs. No nesting is allowed in rotary motion programs.
Examples:
IF (P1>10) M1=1
IF (M11=0 AND M12!=0) M2=1 M3=1
IF (M1=0) P1=P1-1
ELSE P1=P1+1
IF (M11=0)
P1=1000*SIN(P5)
X(P1)
ENDIF
IF (P1<0 OR P2!<0)
AND (P50=1)
X(P1)
DWELL 1000
ELSE
X(P1*2)
DWELL 2000
ENDIF
See Also:
Conditions (Program Computational Features)
Program commands ELSE, ENDIF, WHILE, AND, OR
INC
Function: Incremental Move Mode
Type: Motion program
Syntax: INC [({axis}[,{axis}...])]
where:
{axis} is a letter specifying a motion axis (X, Y, Z, A, B, C, U, V, W), or the letter R specifying the
arc center radial vector.