2 the maxl for statement, 4 jump statements – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 90

Advertising
background image

5.5.3.2 The MAXL for Statement

The for statement can be divided into three separate parts, as shown in

Table 5-6 Table for Loop Elements

Syntax
Name

When Executed

Contents

Identifier-variable
= expression

Before any other element
of the for statement or the
substatement.

Used to initialize loop
indices.

step-
expression

Before execution of a
given iteration of the
loop, excluding the first
iteration.

Calculates iteration
step. If this field is
absent iteration step is
1.

terminate-
expression

At the end of each
iteration of the loop.

Used as loop-
termination criteria.

The for-statement executes the statements repeatedly until the identifier-value is less or
equal to terminate-expression value. The step-expression field is optional. If the step-
expression
has a negative value then the for-statement executes the statements
repeatedly until the identifier-value is greater than or equal to the terminate-expression
value.

Syntax

for identifier-variable=expression : [step- expression :] terminate-expression

statements

end for

Example:

for i=1:1:10

test(i)

end for

5.5.4

Jump Statements

The MAXL jump statements perform an immediate local transfer of control.

Syntax

jump-statement:

Maestro

Software Manual

MAXL Program Language

MAN-MASSW (Ver. Q)

5-28

Advertising