Omron CX-PROGRAMMER V8.1 Operation Manual page 83

Function blocks/ structured text
Table of Contents

Advertisement

Function Block Applications Guidelines
Passing Values from or
Monitoring Output
Variables
Input-Output Variables to
Return FB Processing
Results from Values
Passed from Input
Parameters to Output
Parameters
Input-Output Array
Variables to Pass Large
Amounts of Data
58
To paste into the program and then pass values outside (the program) from
the function block for each instance, or monitor values, use output variables.
Program
Instance for function block definition A.
The actual value is
passed.
Variable for passing a value outside or monitoring:
Use an output variable.
The following restrictions apply.
• Values are passed from output variables to output parameters all at once
after algorithm execution.
An input-output variable can be used to implement the functionality of both
input and output parameters. Internal operation involves passing the address
set for the parameter to the input-output variable, but the use of the input-out-
put variable inside the function block is the same as that of other variables.
Program Section
Instance of FB definition A
Specify an address for the input parameter;
the address will be passed to the FB.
D100
a
Use an input-output variable to implement
both input and output variable functions
while changing the value in the FB.
This address
D100
is passed.
(Example: WORD data type)
Input-output variables can be set as arrays (which is not possible for input
variables and output variables). If an input-output array variable is used, a
range of addresses of the specified size starting from the address set for the
input parameter can be used inside the FB. Input-output variables should thus
be used when it's necessary to pass large quantities of data to a function
block.
Program Section
Instance of FB definition A
Specify an address for the input parameter;
the address will be passed to the FB.
D200
Data
Use an input-output variable to pass large
quantities of data to the FB (only the first
address is actually passed).
This address
D200
is passed.
D201
WORD data
Array setting
10 elements
D209
OK_Flag
W0.00
NG_ Flag
W0.01
a
D100
D100 can be used
in the rest of the
program after being
changed in the FB.
Contents can be changed in the FB.
"a" indicates D100.
a
Data
D200
D200 to D2009 can
be used in the rest
of the program after
being changed in
the FB.
Contents can be changed in the FB.
Data
"Data[0]" indicates D200.
"Data [1]" indicates D201
Etc.
Section 2-5

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