C-863.12 Mercury Controller MS249E Version: 1.2.1 175
MAT (Calculate And Save To Variable)
Carries out a mathematical operation or bit operation and
saves the result as a variable (p. 118).
The variable is in volatile memory (RAM) only.
MAT <Variable> "=" <FLOAT1> <OP> <FLOAT2>
<Variable> is the name of the variable where the result is
to be saved.
<FLOAT1> and <FLOAT2> are the values for calculating the
result. They can be specified directly or via the value of a
variable.
<OP> is the operator to be used: The following operators
are possible:
Important: There must be a blank space before and after
each "=" and the operator!
Using MAT to set local variables is only possible in macros.
Send: MAT TARGET = ${POS} * 2.0
The TARGET variable contains 2.0 times the value of the
POS variable.
Send: MAT TARGET = 2 * 0x10
Send: VAR? TARGET
Receive: TARGET=32
NOTICE: The values from which the result is to be
calculated can be written in hexadecimal or decimal
format. The result is always output in decimal format.