Omron TJ2-MC64 - PROGRAMMING Programming Manual page 107

Hide thumbs Also See for TJ2-MC64 - PROGRAMMING:
Table of Contents

Advertisement

BASIC commands
Syntax
FOR variable = start TO end [STEP increment]
commands
NEXT variable
Description
The FOR ... NEXT loop allows the program segment between the FOR and
the NEXT statement to be repeated a number of times.
On entering this loop, the variable is initialized to the value of start and the
block of commands is then executed. Upon reaching the NEXT command, the
variable is increased by the increment specified after STEP. The STEP value
can be positive or negative, if omitted the value is assumed to be 1.
While variable is less than or equal to end, the block of commands is repeat-
edly executed until variable is greater than end, at which time program execu-
tion will continue after NEXT.
Note: FOR ... NEXT statements can be nested up to 8 levels deep in a BASIC
program.
Arguments
variable
Any valid BASIC expression.
start
Any valid BASIC expression.
end
Any valid BASIC expression.
increment
Any valid BASIC expression.
commands
One or more BASIC commands.
Example
FOR opnum = 8 TO 13
OP(opnum,ON)
NEXT opnum
This loop turns on outputs 8 to 13.
Example
loop:
FOR dist = 5 TO -5 STEP -0.25
MOVEABS(dist)
GOSUB pick_up
NEXT dist
The STEP increment can be positive or negative.
PROGRAMMING MANUAL
Example
loop1:
FOR l1 = 1 TO 8
loop2:
FOR l2 = 1 TO 6
MOVEABS(l1*100,l2*100)
GOSUB 1000
NEXT l2
NEXT l1
FOR..TO..STEP..NEXT statements can be nested (up to 8 levels deep) pro-
vided the inner FOR and NEXT commands are both within the outer
FOR..TO..STEP..NEXT loop.
See also
REPEAT..UNTIL, WHILE..WEND.
3.2.135 FORCE_SPEED
/i
Type
Axis parameter
Syntax
FORCE_SPEED = value
Description
The FORCE_SPEED parameter is used to directly control the speed when
forced speed moves (MOVESP, MOVEABSSP, MOVECIRCSP,
MHELICALSP) are loaded. The FORCE_SPEED parameter should be set to
the required value at the time of loading the move into the buffer.
If two forced speed move types are merged, the speed at the merge point is
controlled by the ENDMOVE_SPEED of the outgoing move. If a forced speed
move follows one or more non-forced speed moves the deceleration will
occur to the FORCE_SPEED of the incoming move.
Arguments
N/A
Example
FORCE_SPEED=2000
See also
MOVESP, ENDMOVE_SPEED
101

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tj1-prtTj1-drtTj1-cortTj1-mlGrt1-ml2Tj1-fl02

Table of Contents