D.2.4 substitution operator, D.2.5 functions, D.2.6 others – Yaskawa MP900 Series Ladder Programming Manual User Manual

Page 408

Advertising
background image

D.2 National Limitations

D.2.4 Substitution Operator

D-6

D.2.4 Substitution Operator

Real number and integer registers can be substituted with either real number or integer data, even if the data type dif-
fers on the right and left sides. When you substitute an integer with a real number, a round-off error will occur.
Bit registers can be substituted only with logical values, such as another bit register or a TRUE/FALSE. If you substi-
tute a bit register with a non-logical value, that value will be compared against 0 or 0.0 and the TRUE or FALSE out-
come will be converted to a code before it is substituted.
Bit data cannot be substituted into non-bit registers.

D.2.5 Functions

The arguments and return values for functions depend on the specifications of the functions in the Machine Controller.
Therefore, if the input for the sin(), cos(), and atan() functions is an integer or integer register, the output value will be
returned as an integer. If the input is a real number or a real number register, the output value will be returned as a real
number.
The argument for the tan() function is a real number so an integer register input will be treated as a real number.

D.2.6 Others

„

Parentheses

You can group multiple expressions by enclosing them with parenthesis ( ).

„

Arrays

You can specify arrays by using square brackets [ ], just like with the C language.

MW00001 = MW00002;

OK

MF00000 = MW00002 / 345;

OK

MB000010 = MB000010;

OK

MW00010 = MB0000101;

NG

MW00001 = true;

NG

EXAMPLE

MW00001 = sin(MW00002);

OK

MF00002 = cos(MF00000 × 3.14);

OK

MW00001 = -atan(MF00002);

OK

EXAMPLE

MW00001 = -(MW00002 + 10) / (MW00003 – MW00005);

OK

EXAMPLE

MW00001 = MW00002[100];

OK

MW00001 = MW00002[MW00003];

OK

MB000010 = MB000020[0]:

OK

EXAMPLE

Advertising
This manual is related to the following products: