Elmomc Multi-Axis Motion Controller-Maestro Manual de usuario Pagina 89

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 313
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 88
otherwise
TRACE (“Error attribute ”)
end switch
The preceding code fragment shows how switch statements can be nested.
The switch statement that selects on the value of
cmdName is executed only if attribute is
1. The case labels for menu selections, 1 (BG) and 2 (MO=1), associate with the inner
switch statement.
5.5.3 Iteration Statements
Iteration statements cause statements (or compound statements) to be executed zero
or more times, subject to some loop-termination criteria. When these statements are
compound statements, they are executed in order, except when either the break
statement or the continue statement is encountered. For a description of these
statements, see The break Statement
and The continue Statement sections.
MAXL provides two iteration statements — while and for. Each of these iterates until
its termination expression evaluates to zero (false), or until loop termination is forced
with a break statement.
Syntax
iteration-statement :
while ( expression ) statements end while
for identifier-variable=expression : [step- expression :] terminate-expression
statements
end for
5.5.3.1
Maestro
Software Manual MAXL Program Language
MAN-MASSW (Ver. Q)
The MAXL while Statement
The while statement executes a statement repeatedly until the termination condition
(the expression) specified evaluates to zero.
The test of the termination condition takes place before each execution of the loop;
therefore, a while loop executes zero or more times, depending on the value of the
termination expression.
Syntax
while ( expression ) statements end while
Example:
while( attribute < 56)
attrbute=attribute+17
TRACE(“Attribute : %”, attribute)
end while
5-27
Vista de pagina 88
1 2 ... 84 85 86 87 88 89 90 91 92 93 94 ... 312 313

Comentarios a estos manuales

Sin comentarios