3 ) programming example, 4 ) additional information – Yaskawa MP900 Series Ladder Programming Manual User Manual

Page 163

Advertising
background image

5.5 Program Control Instructions

5.5.9 IF Construct (IF, END_IF)

5-94

( 3 ) Programming Example

When the conditional expression (MB000001) for the IF instruction turns ON, the value of MW00010 is set in
MW01000 and MW00011 is incremented.

( 4 ) Additional Information

[ a ] Applicable Conditional Expressions

The conditional expression for an IF instruction must be written with the format for an EXPRESSION instruction to
produce a Boolean (TRUE or FALSE) result. Numerical expressions that include substitution operators will not be rec-
ognized.

∗ Refer to Appendix D Format for EXPRESSION Instruction for details on applicable instructions, operation order, and

notation conventions.

[ b ] Nesting Depth

The FOR, WHILE, and IF constructs can contain other constructs. This is called nesting. The maximum depth of a
nested structure that uses FOR, WHILE, and IF statements is limited to 8 levels.
If an instruction is preceded by a contact, it is treated like an IF construct and is included in the number of nesting lev-
els.

Expression Example

Notation

Remarks

MB000001 == true

OK

TRUE: 1 (ON)

MB000001 != false

OK

FALSE: 0 (OFF)

MW00002 < 100

OK

MF00002 < sin(60.0)

OK

MW00001 == 0x00FF OK

OK

Prefix hexadecimal values with 0x.

MB000001 = true

NG

MW00001 = MW00002

NG

Advertising
This manual is related to the following products: