Variable - Omron CX-PROGRAMMER V8.1 Operation Manual

Function blocks/ structured text
Table of Contents

Advertisement

Statement Descriptions
Note
■ Processing Flow Chart
Iteration variable = Initial
Iteration
True
variable ≥
Final value?
False
Expression
Iteration variable + Increment value
End
■ Usage
Use the FOR statement when the number of iterations has been determined
beforehand. FOR is particularly useful when switching the number of ele-
ments in an array variable according to the value of a specified iteration vari-
able.
■ Description
When the iteration_variable is the initial_value, the expression is executed.
After execution, the value obtained from the increment_equation is added to
the iteration_variable, and if the iteration_variable < final_value_equation (see
note 1), the expression is executed. After execution, the value obtained from
the increment_equation is added to the iteration_variable, and if the
iteration_variable < final_value_equation value (see note 1), the expression is
executed. This process is repeated.
If the iteration_variable
ends.
(1) If the value from the increment_equation is negative, the condition is
iteration_variable > final_value_equation value.
(2) If the value from the increment_equation is negative, the condition is
iteration_variable
■ Precautions
• A negative value can be specified in the increment_equation
• FOR must be used in combination with END_FOR.
• The initial_value, final_value_equation, and final_value_equation must be
an integer data type (INT, DINT, LINT, UINT, UDINT, or ULINT).
• After processing is executed with the final value, the iteration value is
incremented to the final value + 1 and iteration processing ends.
Example: In the following structured text, the value of "a" becomes TRUE.
Iteration
final_value_equation (see note 2), the processing
final_value_equation.
Section 5-5
155

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac ws02-cxpc1-v8Sysmac cx-programmer 8.1

Table of Contents