beautypg.com

D.2 national limitations, D.2.1 arithmetic operators, D.2.2 comparison operators – Yaskawa MP900 Series Ladder Programming Manual User Manual

Page 407: D.2.3 logic operators, Appd

background image

D.2 National Limitations

D.2.1 Arithmetic Operators

D-5

Format for EXPRESSION Instruction

AppD

D.2

National Limitations

Several limitations apply when combining operands and operators to form numeric expressions. An expression is not
recognized as a numeric expression unless it meets these conditions.
This section describes these limitations.

D.2.1 Arithmetic Operators

These operators can be used with integer and real number operands. The unary minus operator can be used only once.
Bit operations can be performed only on integer data. Bit operands cannot be used for arithmetic operations. No auto-
matic data type conversion is performed even if the calculation result exceeds the range of the assigned register. There-
fore, the user must assign the appropriate data type to the variable.

D.2.2 Comparison Operators

These operators can be used with integer and real number operands. The left side must be a bit data register. To use an

integer bit operand in a comparison operation with the == or != operator, compare it with TRUE or FALSE.

D.2.3 Logic Operators

These operators can be used with bit operands.

MW00001 = MW00002 + MW00003

OK

MW00001 = MW00002 / 345

OK

MF00002 = (MW00004 + MF00002) / (ML00018 + MW00008)

OK

MW00001 = MW00002 & 4096

OK

MB000010 = MB000011 - MB000012

NG

MW00001 = MB000011 * MW00001

NG

EXAMPLE

MB000010 = MW00002 != MW00003

OK

MB000010 = MF00002 < 99.99

OK

MB000010 = MW00002 >= MW00003

OK

MB000010 = MB000011 == true

OK

MB000010 = MB000011 != 0

NG

MB000010 = MB000011 == 1

NG

EXAMPLE

MB000010 = MB000011 && MB000012

OK

MB000010 = !MB000011

OK

MB000010 = (MW000020 >= 50) && MB000011

OK

MB000010 = MW00001 || MW00002

NG

MB000010 = !MW00001

NG

EXAMPLE

This manual is related to the following products: