User Manual

5 Programming
Register := Expression;
where:
Register must be writable and may be any of the following:
Variable
Local Variable
Register - specified by its tag name
Register - specified by an address
The semicolon at the end is not required if the Expression command contains only one
assignment.
Expression is a mathematical expression that must evaluate to a numeric value with
the same data type
as the Register.
Sample Expressions
Example 1
MyCounter := MyCounter +1;
Note: MyCounter must exist as a variable.
Example 2
MyVariable := 12.9 + SampleVariable2 / (3.0 + Axis[1].ActPrs);
Note: MyVariable and SampleVariable2 must exist as variables.
Example 3
F18:2 := 3.0 + ABS(Axis[].ActPos);
Example 4
IF _Axis[0].StatusBits.0 = True THEN
MyREAL1 := 34.0;
MyREAL2 := 70023.0;
ELSEIF ABS(_Axis[0].ActPos) > 20.0 THEN
%QX0.1 := True;
ELSE
MyDINT := 2;
END_IF
Note: MyReal1, MyReal2, and MyDINT must exist as variables.
Entering an Expression
1. In a User Program, choose the Expression (113) command, and double-click the
Expression box. The Expression Editor will open.
2. Enter the first register and the assignment operator. Note that the Expression must
begin with "[register] := ".
To enter the first part of the expression:
deltamotion.com 323