Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION Operation Manual page 26

Function blocks
Table of Contents

Advertisement

Function Blocks
Note
!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
Even if an input source address (i.e., an input parameter) or an output desti-
nation address (i.e., an output parameter) is a word address, the data that is
passed will be the data in the form and size specified by the variable data type
starting from the specified word address.
Program
Examples:
If m is type WORD, one word of data from D100 will be passed to the
variable.
If n is type DWORD, two words of data from D200 and D201 will be
passed to the variable.
If k is type LWORD, four words of data from the variable will be passed
to the D300 to D303.
(1) Only addresses in the following areas can be used as parameters: CIO
Area, Auxiliary Area, DM Area, EM Area (banks 0 to C), Holding Area,
and Work Area.
The following cannot be used: Index and Data Registers (both direct and
indirect specifications) and indirect addresses to the DM Area and EM
Area (both in binary and BCD mode).
(2) Local and global symbols in the user program can also be specified as
parameters. To do so, however, the data size of the local or global symbol
must be the same as the data size of the function block variable.
(3) When an instance is executed, input values are passed from parameters
to input variables before the algorithm is processed. Output values are
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.
■ Reference Information
A variety of processes can be created easily from a single function block by
using parameter-like elements (such as fixed values) as input variables and
changing the values passed to the input variables for each instance.
Example: Creating 3 Instances from 1 Function Block Definition
Instance of Function Block Definition A
m
k
Input D100
Input D200
n
Section 1-2
Output D300
11

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-programmer 5.0Sysmac ws02-cxpc1-e-v50Cs1-hCj1-hCj1m

Table of Contents