Manual
10-2 Using ACL Variables
where <varid> is a variable i.d. After this command has been executed, the next ACL
output command (OA, OC, etc.) sends its values into variable(s) instead of sending them to
the host computer. <varid> specifies the first variable which is to receive a value.
Subsequent values go into the next higher-numbered variable(s). For example:
VC 11; OC;
puts the current commanded X position into variable 11 and the current commanded Y
position into variable 12.
Other commands which can change the value of a variable are: V+, V-, V*, V/, V&, V,
V!. Respectively, these commands add a value to a variable, subtract a value, multiply by a
value, divide by a value, logically AND with a value, logically OR with a value, and bitwise
ones'-complement a variable. The logical operations always return zero for the fractional
part of the value.
Finally, the SC ("Scale") command converts between Calibrated Units and raw microstep
positions; the VL (Vector Length) command computes the length of a vector; the VR (Vector
Rotate) command performs a trigonometric rotation of a vector endpoint about a specified
point; and VA (Vector Angle) computes the rotation angle of a specified vector.
The
ESC.!9: escape sequence sets the values of all variables to 0.0. Since the variables are
stored in non-volatile battery-backed RAM their values are not affected by turning the power
off, then back on. It is the user's responsibility to see that the variables get initialized to the
proper values at the proper times.
How To Test Variables
The OV ("Output Variable") command sends the current contents of a variable to the host
computer. For example, OV 8; sends the contents of variable 8.
To modify the execution of a Download Sequence based on the value of a variable, use one
of the following commands: VT ("Variable Test"), V< (Variable Less Than), V= (Variable
Equal To), or V> (Variable Greater Than).
After a VT command has been executed, the next XI, XU, XW, or ON command tests the
value of the variable (bits 0 through 7), rather than testing the Digital Inputs.
The V< command tests if the contents of a variable is less than a specified value. The next
XI, XU, XW, or ON can check the results of the comparison; bit 0 will be "1" if the
comparison was True (i.e., if the variable was less than the specified value). Similarly, V=
tests for a variable being equal to a value, and V> tests for greater than. For example:
V= 3, 19.33; XI 40, 1, 1;
executes Download Sequence 40 if and only if the value of variable 3 is exactly 19.33.
Another example:
V> 5, 20; XU 50, 1, 1;