beautypg.com

Literal numbers and dimensions, Operators – MTS Series 793 User Manual

Page 374

background image

All integer signals are 32-bit integers.

Floating point data within the calculation engine are 64-bit floating points.

Integer data within the calculation engine are 32-bit integers.

Data values are converted as necessary, so you generally do not need to be concerned with them.

Literal Numbers and Dimensions

Expressions are evaluated in system units. System units are based on millimeters, kilo newtons, and seconds.
The Calculation Editor window displays the system units used by all selected signals. Look in the file
SYSDEF.UAS for a full list of the system units. The values that the expression reads from signals and
calculation parameters will be in these units. The value assigned to the result signal must be in the appropriate
signal unit.

If literal values are put into the expression, they must be interpreted in system units.

The calculation engine does not perform unit conversion or dimensional analysis.

Operators

The language understands the normal plus, minus, multiply, and divide operators. The default precedence
of these operators matches most programming and mathematical languages. The language evaluates all
multiplication and division (left to right) and then all addition and subtraction (left to right). To change the order
of evaluation, you use parenthesis operators.

For example:

“Axial Force” = (“Axial Force 1” + “Axial Force 2”) / 2;

The following table shows all the recognized operators organized by group and listed in order of precedence.
Within a group, all operators have the same precedence.

Calculation Editor Window Operators

Direction

Result type

Operand type

Function

Operator

Precedence

Left-to-right

Int or real

Int

Array index

[ ]

1

(same as
operand)

Int or real

Function call

( )

Right-to-left

(same as
operand)

Int or real

Logical NOT

!

2

Right-to-left

(same as
operand)

Int or real

Unary minus

3

Left-to-right

(same as
operands)

Int or real

Multiply

*

4

Divide

/

Left-to-right

(same as
operands)

Int or real

Addition

+

5

374 MTS Series 793 Control Software

Calculated Signals