![Omron CS1-H Series Скачать руководство пользователя страница 26](http://html1.mh-extra.com/html/omron/cs1-h-series/cs1-h-series_operation-manual_742526026.webp)
11
Function Blocks
Section 1-2
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.
Note
(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).
!Caution
If an address is specified in an input parameter, the values in the address are
passed to the input variable. The actual address data itself cannot be passed.
!Caution
Parameters cannot be used to read or write values within the execution cycle
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
m
k
n
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.
Program
Input D100
Instance of Function Block Definition A
Output D300
Input D200
Содержание CS1-H Series
Страница 3: ...iv...
Страница 5: ...vi...
Страница 7: ...viii TABLE OF CONTENTS...
Страница 15: ...xvi Application Precautions 4...
Страница 151: ...136 Procedures Section 3 2...
Страница 153: ...138 Data Types Appendix A...
Страница 177: ...162 External Variables Appendix C...
Страница 181: ...166 Revision History...