14.01.2015 Views

Gemini GV6K and Gemini GT6K Programmer's Guide

Gemini GV6K and Gemini GT6K Programmer's Guide

Gemini GV6K and Gemini GT6K Programmer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Conditional Looping <strong>and</strong> Branching<br />

Flow Control<br />

Expression<br />

Examples<br />

Conditional looping (REPEAT/UNTIL <strong>and</strong> WHILE/NWHILE) entails repeating a set of<br />

comm<strong>and</strong>s until or while a certain condition exists. In conditional branching<br />

(IF/ELSE/NIF), a specific set of comm<strong>and</strong>s is executed based on a certain condition. Both<br />

rely on the fulfillment of a conditional expression, a condition specified in the UNTIL,<br />

WHILE, or IF comm<strong>and</strong>s.<br />

A WAIT comm<strong>and</strong> pauses comm<strong>and</strong> execution until a specific condition exists.<br />

This section provides examples of expressions that can be used in conditional branching <strong>and</strong><br />

looping comm<strong>and</strong>s (UNTIL, WHILE, <strong>and</strong> IF) <strong>and</strong> the WAIT comm<strong>and</strong>. These expressions can<br />

be constructed, in conjunction with relational <strong>and</strong> logical operators, with the following<br />

oper<strong>and</strong>s:<br />

• Numeric variables <strong>and</strong> binary variables<br />

• Inputs <strong>and</strong> outputs<br />

• Current motion parameters <strong>and</strong> status<br />

• Current comm<strong>and</strong>ed <strong>and</strong> actual position<br />

• Error, axis, <strong>and</strong> system status<br />

• Timer value<br />

• Data read from the serial port<br />

• Data read from the RP240<br />

• Following conditions<br />

• Multi-tasking conditions<br />

Numeric <strong>and</strong> Binary<br />

Variables<br />

A numeric variable (VAR or VARI) can be used within an expression if it is compared against<br />

another numeric variable, a value, or one of the comparison comm<strong>and</strong>s (see list on page 7).<br />

When comparing a variable against another value, variable, or comparison comm<strong>and</strong>, the<br />

relational operators (=, >, >=, =, =, , >=,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!