Reference Manual

Turbo PMAC/PMAC2 Software Reference
Turbo PMAC Program Command Specification 432
ENABLE PLCC 1,2,5
ENABLE PLCC 1..16
ENA PLCC 7
See Also:
I-variable I5
On-line commands ENABLE PLC, DISABLE PLC, ENABLE PLCC, DISABLE PLCC, <CONTROL-
D>
Program command ENABLE PLC, DISABLE PLC, DISABLE PLCC
ENDIF
Function: Mark End of Conditional Block
Type: Motion program (PROG only), PLC program
Syntax: ENDIF
ENDI
This statement marks the end of a conditional block of statements begun by an IF statement. It can close
out the true branch, following the IF statement, in which case there is no false branch, or it can close out
the false branch, following the ELSE statement.
When nesting conditions, it is important to match this ENDIF with the proper IF or ELSE statement. In
a PLC program, every IF or IF/ELSE pair must take an ENDIF, so the ENDIF always matches the
most recent IF statement that does not already have a matching ENDIF. In a motion program an IF or
ELSE statement with action on the same line does not require an ENDIF, so the ENDIF would be
matched with a previous IF statement.
Examples:
IF (P1>0)
X1000
ENDIF
IF (P5=7)
X1000
ELSE
X2000
ENDIF
See Also:
Logical Structures (Writing and Executing Motion Programs)
Conditional Statements (Writing a PLC Program)
Program commands IF, ELSE
ENDWHILE
Function: Mark End of Conditional Loop
Type: Motion program (PROG only), PLC program
Syntax: ENDWHILE
ENDW
This statement marks the end of a conditional loop of statements begun by a WHILE statement. WHILE
loops can be nested, so an ENDWHILE statement matches the most recent WHILE statement not already
matched by a previous ENDWHILE statement.
In a motion program a WHILE statement with an action on the same line does not require a matching
ENDWHILE.