Function Blocks
!Caution If an address is specified in an input parameter, the values in the address are
!Caution Parameters cannot be used to read or write values within the execution cycle
Note
16
passed from output variables to parameters just after processing the al-
gorithm. If it is necessary to read or write a value within the execution cy-
cle of the algorithm, do not pass the value to or from a parameter. Assign
the value to an internal variable and use an AT setting (specified address-
es).
passed to the input variable. The actual address data itself cannot be passed.
of the algorithm. Use an internal variable with an AT setting (specified
addresses). Alternatively, reference a global symbol as an external variable.
Using Input-Output Variables (In Out)
When using an input-output variable, set the address for the input parameter.
A constant cannot be set. The address set for the input parameter will be
passed to the function block. If processing is performed inside the function
block using the input-output variable, the results will be written to I/O starting
at the address set for the size of the variable.
Program
Instance of function block definition A
D200
a
Input
Address passed.
Processing is performed inside the function block using variable
"a." The resulting value is written to I/O memory for the size of
variable "a" starting at address D200.
Input-output variables are specified in a CX-Programmer variable table by
selecting "In Out" for the variable usage.
Automatically set.
a
Output
D200
Address passed.
"a" changed by function
block processing.
D200
D201
Variable "a"
Section 1-2
Need help?
Do you have a question about the CX-PROGRAMMER V8.1 and is the answer not in the manual?
Questions and answers