![background image](http://html1.mh-extra.com/html/omron/r88a-mcw151-drt-e/r88a-mcw151-drt-e_operation-manual_742243156.webp)
141
Command, function and parameter description
Section 6-3
Examples:
Example 1
The following loop turns ON outputs 8 to 13.
FOR opnum = 8 TO 13
OP(opnum,ON)
NEXT opnum
Example 2
The STEP increment can be positive or negative.
loop:
FOR dist = 5 TO -5 STEP -0.25
MOVEABS(dist)
GOSUB pick_up
NEXT dist
Example 3
FOR...NEXT statements can be nested (up to 8 levels deep) provided the
inner FOR and NEXT commands are both within the outer FOR...NEXT loop:
loop1:
FOR l1 = 1 TO 8
loop2:
FOR l2 = 1 TO 6
MOVEABS(l1*100,l2*100)
GOSUB 1000
NEXT l2
NEXT l1
6-3-80
FORWARD
Type:
Motion Control Command
Syntax:
FORWARD
Alternative:
FO
Description:
The FORWARD command moves an axis continuously forward at the speed
set in the SPEED axis parameter. The acceleration rate is defined by the
ACCEL axis parameter.
FORWARD works on the default basis axis (set with BASE) unless AXIS is
used to specify a temporary base axis.
Precautions:
The forward motion can be stopped by executing the CANCEL or RAPID-
STOP command, or by reaching the forward limit.
See also:
AXIS, CANCEL, RAPIDSTOP, REVERSE, UNITS
Example:
start:
FORWARD
WAIT UNTIL IN(0) = ON
’Wait for stop signal
CANCEL
6-3-81
FRAC
Type:
Mathematical Function
Syntax:
FRAC(
expression
)
Description:
The FRAC function returns the fractional part of the expression.
Arguments:
expression
Any valid BASIC expression.
Example:
>> PRINT FRAC(1.234)
0.2340
6-3-82
FREE
Type:
System Function