omron — ENDIF

PMAC Product Guide This second example has a multi-line true branch, and a single-line false branch. This can be used only in a motion program. IF (M11=0) X(P1) DWELL 1000 ELSE DWELL 500 This example has a single-line true branch, and a multi-line false branch. This structure can be used only in a motion program. IF (SIN(P1)>0.5) Y(1000*SIN(P1)) ELSE P1=P1+5 Y(1100*SIN(P1)) ENDIF This example has single-line true and false branches. This structure can be used only in a motion program. IF (P1 ! ELSE X-10 ENABLE PLC Function : Enable PLC Buffer(s) Type : Motion program (PROG and ROT), PLC program Syntax :

ENABLE PLC {constant}[,{constant}...] ENABLE PLC {constant}[..{constant}] ENA PLC {constant}[,{constant}...] ENA PLC {constant}[..{constant}] This command enables the operation of the specified PLC buffers provided I5 is set properly to allow their operation. Examples: ENABLE PLC 0 ENABLE PLC 1,2,5 ENABLE PLC 1..16 ENA PLC 7 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. Buffer Commands 213