User guide
Chapter 1. Programming Fundamentals
27
RP240 Data Read
Immediate Mode
(Stand-alone
products only)
The DREADI1 command allows continual numeric or function key data entry from the RP240
(when used in conjunction with the DREAD and/or DREADF commands). In this immediate
mode, program execution is not paused (waiting for data entry) when a DREAD or DREADF
command is encountered. Refer to the DREAD and DREADF command descriptions for
programming examples.
NOTES
• While in the Data Read Immediate Mode, data is read into numeric variables only (VAR).
• This feature is not designed to be used in conjunction with the RP240's standard menus;
the RUN, JOG, and DJOG menus will disable the DREADI mode.
• Do not assign the same variable to read numeric data and function key data—pick only
one.
Following Conditions
These Following conditions are available for conditional expressions: Axis status bit #26
(AS.26), Error status bit #14 (ER.14), Following status (FS), NMCY, PMAS, PSHF, PSLV,
and VMAS.
Expression Description
(2AS.26=b1) True if a new motion profile on axis 2 is waiting for the GOWHEN condition to
be true or a TRGFNc1xxxxxxx trigger.
(1ER.14=b1) True if the GOWHEN condition on axis 1 is already true when the subsequent
GO, GOL, FSHFC, or FSHFD command is executed.
(3FS.7=b0) True if the master for slave axis 3 is in motion.
(2NMCY>200) True if the master for axis 2 has moved through 200 cycles.
(1PMAS>12) True if the master for axis 1 has traveled more than 12 units.
(1PSHF>1.5) True if slave axis 2 has shifted more than 1.2 units.
(3PSLV>24) True if slave axis 3's commanded position is more than 24 units.
(1VMAS<2) True if the velocity of the master for axis 1 is less than 2 units/sec.
Conditional
Looping
The 6000 controller supports two conditional looping structures—REPEAT/UNTIL and
WHILE/NWHILE.
All commands between REPEAT and UNTIL are repeated until the expression contained
within the parenthesis of the UNTIL command is true. The example below illustrates how a
typical REPEAT/UNTIL conditional loop works. In this example, the REPEAT loop will
execute 1 time, at which point the expression stated within the UNTIL command will be
evaluated. If the expression is true, command processing will continue with the first command
following the UNTIL command. If the expression is false, the REPEAT loop will be repeated.
VAR5=0 ; Initializes variable 5 to 0
DEL prog10 ; Delete a program before defining it
DEF prog10 ; Defines program prog10
INFNC1-A ; Input 1 is not assigned a function, used with IN
INFNC2-A ; Input 2 is not assigned a function, used with IN
INFNC3-A ; Input 3 is not assigned a function, used with IN
INFNC4-A ; Input 4 is not assigned a function, used with IN
OUTFNC1-A ; Output 1 is programmable
A50 ; Acceleration is 50
AD50 ; Deceleration is 50
V5 ; Sets velocity to 5
D25000 ; Distance is 25,000
REPEAT ; Begins the REPEAT loop
GO1 ; Executes the move (Go)
VAR5=VAR5+1 ; Variable 5 counts up from 0
UNTIL(IN=b1110 OR VAR5>10) ; When the inputs 1-4 are 1110, respectively or
; VAR5 is greater than 10, the loop will stop.
OUT1 ; Turn on output 1 when finished with REPEAT loop
END ; End program definition
RUN prog10 ; Initiate program prog10










