beautypg.com

Mathematical and functional expressions, Examples – Yaskawa LEGEND-MC User Manual

Page 310

background image

300

LEGEND-MC User’s Manual

Mathematical and Functional Expressions

For manipulation of data, the LEGEND-MC provides the use of the following mathematical operators:

The numeric range for addition, subtraction and multiplication operations is +/-2,147,483,647.9999. The
precision for division is 1/65,000.

Mathematical operations are executed from left to right. Parentheses can be used and nested four deep.
Calculations within a parentheses have precedence.

Examples:

Operator

Function

+

Addition

-

Subtraction

*

Multiplication

/

Division

&

Logical And (Bit-wise)

|

Logical Or (On some computers, a solid vertical line appears as a broken line)

( )

Parenthesis

SPEED=7.5*V1/2

The variable, SPEED, is equal to 7.5 multiplied by V1 and

divided by 2

COUNT=COUNT+2

The variable, COUNT, is equal to the current value plus 2.

RESULT=_TPX-
(@COS[45]*40)

Puts the position of X - 28.28 in RESULT. 40 * cosine of
45

° is 28.28

TEMP=@IN[1]&@IN[2]

TEMP is equal to 1 only if Input 1 and Input 2 are high