Omron WS02-CXPC1-V9 - V9 Operation Manual page 186

Table of Contents

Advertisement

Statement Descriptions
RETURN Statement
Function Block Call
Statement
Note
160
FOR n:=1; TO 50 BY 1 DO
DATA[n]:=DATA[n]+n;
IF DATA[n]>100 THEN EXIT;
END_IF;
END_FOR;
■ 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.
■ 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.
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)
Section 5-5

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cx-programmer 9Sysmac ws02-cxpc1-v9

Table of Contents