User guide

26
6000 Series Programmer's Guide
Current Motor and
Encoder Position
(Stepper Products
Only)
The current motor and encoder positions (PCE, PCM, PE, PER, PM, PMAS, PSHF, PSLV) can
be used within an expression, if the operand is compared against a numeric variable or value.
When making the comparison, the relational operators (=, >, >=, <, <=, <>) and logical
operators (AND, OR, NOT) are used.
Expression Description
(VAR1<1PM) True expression if VAR1 is < commanded motor position of axis 1
(2PE=25000) True expression if axis 2 encoder position equals 25000
Current Commanded
& Actual Position
(Servo Products
Only)
The current commanded and feedback device positions (ANI, CA, DAC, FB, LDT, PANI, PC,
PCA, PCC, PCE, PCL, PER, PE, PMAS, PSHF, PSLV) can be used within an expression, if
the operand is compared against a numeric variable or value. When making the comparison,
the relational operators (=, >, >=, <, <=, <>) and logical operators (AND, OR, NOT) are used.
Expression Description
(VAR1<1FB) True expression if the value of variable 1 is less than the actual
position (position of the assigned feedback device) of axis 1
(2PC=4000) True expression if axis 2 commanded position equals 4000
Error, Axis, and
System Status
The error status, axis status, and system status operands (ER, AS, SS) can be used within an
expression, if the operand is compared against a binary variable or a binary or hexadecimal value.
When making the comparison, the relational operators (=, >, >=, <, <=, <>) and logical
operators (AND, OR, NOT) are used. Refer to page 232 for a list of status bit functions.
Expression Description
(ER.12=b1) True expression if error status bit 12 is equal to 1
(AS=h3FFD) True expression if axis status is equal to hexadecimal 3FFD
Timer and Counter
Values (Counter
available on
stepper products
only)
The current timer and counter values (TIM and CNT) can be used within an expression, if the
operand is compared against a numeric variable or value. When making the comparison, the
relational operators (=, >, >=, <, <=, <>) and logical operators (AND, OR, NOT) are used.
Expression Description
(VAR1<TIM) True expression if the value of variable 1 is less than the timer
value
(1CNT>23567) True expression if the value of counter #1 is greater than 23567
Data Read from the
Communications
Port
The READ command can be used to input data from the RS-232C serial port or the PC bus
into a numeric variable. After the data has been read into a numeric variable, that variable may
be used in an expression.
Example Description
VARS8="ENTER DATA" Define message (string variable 8)
VAR2=READ8 Send message (string variable 8) and then wait for immediate
data to be read (into numeric variable 2)
!'88.3 Immediate data input (must type !' before the numeric value)
IF (VAR2<=100) Evaluate expression to see if data read is < or equal to 100
. . . . .
NIF End of IF
Data Read from the
RP240 (Stand-
alone products
only)
The DREAD and DREADF commands can be used to input data from the RP240 into a numeric
variable. DREAD reads a number from the RP240's numeric keypad. DREADF reads a number
representing a RP240 function key. After the data has been read into a numeric variable, that
variable may be used in an expression.
DCLEAR0 ; Clear RP240 display
DWRITE"HIT F4" ; Send message to RP240 display
VAR3=DREADF ; Read data from a RP240 function key into
; numeric variable 3
IF (VAR3<>4) ; Evaluate expression to see if function key F4 was hit
DCLEAR2 ; Clear RP240 display line 2
DWRITE"TRY AGAIN" ; Send message to RP240 display
NIF ; End of IF