![Parker 6250 User Manual Download Page 82](http://html.mh-extra.com/html/parker/6250/6250_user-manual_755628082.webp)
74
6250 Servo Controller User Guide
Variables
The 6250 has 3 types of variables (numeric, binary, and string). There are 150 numeric
variables, numbered 1 - 150. There are 25 binary and string variables, numbered 1 - 25. Each
type of variable is designated with a different command. The
VAR
command designates a
numeric variable, the
VARB
command designates a binary variable, and the
VARS
command
designates a string variable.
Variables do not share the same memory (i.e.,
VAR1
,
VARB1
, and
VARS1
can all exist at the
same time and operate separately).
Numeric variables are used to store numeric values with a range of
-999,999,999.ØØØØØØØØ
to
999,999,999.99999999
. Mathematical,
trigonometric, and boolean operations are performed using numeric variables.
Binary variables can be used to store 32-bit binary or hexadecimal values. Binary variables can
also store I/O, system, axis, or error status (e.g., the
VARB2=IN.12
command assigns input
bit 12 to binary variable 2). Bitwise operations are performed using binary variables.
String variables are used to store message strings of 20 characters or less. These message
strings can be predefined error messages, user messages, etc.
NOTE
The programming examples in this section make use of the colon (
:
) command delimiter to
allow entering more than one command per line.
Converting Between Binary and Numeric Variables
Using the Variable Type Conversion (
VCVT
) operator, you can convert numeric values to
binary values, and vice versa. The operation is a signed operation as the binary value is
interpreted as a two's complement number. Any don't cares (
x
) in a binary value is interpreted
as a zero (
Ø
).
If the mathematical statement's result is a numeric value, then
VCVT
converts binary values to
numeric values. If the statement's result is a binary value, then
VCVT
converts numeric
values to binary values.
Numeric to Binary
Example
Description/Response
>
VAR1=-5
Set numeric variable value = -5
>
VARB1=VCVT(VAR1)
Convert the numeric value to a binary value
>
VARB1
*VARB1=11Ø1_1111_1111_1111_1111_1111_1111_1111
Binary to Numeric
Example
Description/Response
>
VARB1=bØØ1Ø_Ø11Ø_ØØØØ_ØØØØ_ØØØØ_ØØØØ_ØØØØ_ØØØØ
Set binary variable = +100.0
>
VAR1=VCVT(VARB1)
Convert the binary value to a
numeric value
>
VAR1
*VAR1=+1ØØ.Ø
Performing Operations with Numeric Variables
This section describes how to perform operations with numeric variables.
Some Math Operations Reduce Precision
The following math operations reduce the precision of the return value: Division and
Trigonometric functions yield 5 decimal places; Square Root yields 3 decimal places; and
Inverse Trigonometric functions yield 2 decimal places.
Mathematical
Operations
The following examples demonstrate how the 6250 can perform math operations with its
numeric variables.
Addition (
+
)
Example
Response
>
VAR1=5+5+5+5+5+5+5
>
VAR23=1ØØØ.565
>
VAR11=VAR1+VAR23 : VAR11
*VAR11=+1Ø35.565
>
VAR1=VAR1+5 : VAR1
*VAR1=+4Ø.Ø