Download DS800 Development Suite Software
Transcript
FOR Statement Name: FOR ... TO ... BY ... DO ... END_FOR Meaning: executes a limited number of iterations, using an integer index variable Syntax: FOR <index> := <mini> TO <maxi> BY <step> DO <statement> ; <statement> ; END_FOR; Operands: index: internal integer variable increased at each loop mini: initial value for index (before first loop) maxi: maximum allowed value for index step: index increment at each loop The [ BY step ] statement is optional. If not specified, the increment step is 1 Warning: Because the virtual machine is a synchronous system, input variables are not refreshed during FOR iterations. This is the "WHILE" equivalent of a FOR statement: index := mini; while (index <= maxi) do <statement> ; <statement> ; index := index + step; end_while; Example (* ST program using FOR statement *) (* this program extracts the digit characters of a string *) length := mlen (message); target := ''; (* empty string *) FOR index := 1 TO length BY 1 DO code := ascii (message, index); IF (code >= 48) & (code <= 57) THEN target := target + char (code); END_IF; END_FOR; DS800 Development Suite 2.1 - Language Reference 465
Related documents
Micro800 Programmable Controllers General Instructions
MapPro80_User Manual Addendum
User manual
Parameter Descriptions
DS800 Development Suite Quick Start Guide for the ROC800
CCW Release Notes Release 4.00 - Literature Library
Programmable Logic Controller PLC300
MVS205 Multi-Variable Sensor - Welcome to Emerson Process
User's Manual of ISaGRAF Embedded Controllers
2080-UM001B-EN-E Micro810 Controllers User Manual
2080-UM005A-EN-E Micro820 Programmable Controllers User
DL8000 Preset Controller Instruction Manual