![background image](http://html1.mh-extra.com/html/omron/sysmac-cx-programmer-9/sysmac-cx-programmer-9_operation-manual_744241186.webp)
160
Statement Descriptions
Section 5-5
FOR n:=1; TO 50 BY 1 DO
DATA[n]:=DATA[n]+n;
IF DATA[n]>100 THEN EXIT;
END_IF;
END_FOR;
RETURN Statement
■
Summary
The function of the RETURN statement depends on the type of program in
which ST is used.
• ST program:
Forcibly ends the ST task that is being executed, and executes the next
task.
• ST used in SFC:
Forcibly ends the action program that is being executed, and executes the
next action program or transition program.
• ST used in a function block:
Forcibly ends the ST-language function block containing the RETURN
statement, returns to the place in the calling function block instance where
the call occurred, and executes the next instruction.
■
Reserved Words
RETURN
■
Statement Syntax
RETURN
■
Usage
Use the RETURN statement to forcibly end an SFC program and function
block that is executing an ST task.
Function Block Call
Statement
■
Summary
This statement calls a function block definition.
■
Reserved Words
None
■
Statement Syntax
Enter the arguments (specified variable values that are passed to the called
function block’s input variables) and return value (specified variable that
receives the function block’s output variable value) in parentheses after the
instance name (see note). The two methods (entry method 1 and entry
method 2) that can be used to enter these parameters are described in the fol-
lowing paragraphs.
Note
The data type is any of the function block’s internal variable names (when ST
is used in the function block’s instance) or global variable names (when ST is
used in an ST task or SFC action program).
■
Entry Method 1
Use this method to enter both the argument specification (called function
block definition’s variable name) and return value specification.
A(B:=C, .......... ,D=>E)
Summary of Contents for SYSMAC CX-Programmer 9
Page 2: ......
Page 4: ...iv ...
Page 6: ...vi ...
Page 8: ......
Page 16: ...xvi ...
Page 20: ...xx ...
Page 26: ...xxvi Application Precautions 4 ...
Page 27: ...Part 1 Function Blocks ...
Page 28: ......
Page 154: ...128 Procedures Section 3 2 ...
Page 155: ...Part 2 Structured Text ST ...
Page 156: ......
Page 160: ...134 CX Programmer Specifications Section 4 2 ...
Page 206: ...180 Procedures Section 6 1 ...
Page 208: ...182 System defined external variables supported in function blocks Appendix A ...
Page 230: ...204 Revision History ...
Page 231: ......