17
Usage Procedures
Section 1-5
1-5
Usage Procedures
Once a function block definition has been created and an instance of the algo-
rithm has been created, the instance is used by calling it when it is time to
execute it. Also, the function block definition that was created can be saved in
a file so that it can be reused in other projects (PLCs).
1-5-1
Creating Function Blocks and Executing Instances
The following procedure outlines the steps required to create and execute a
function block.
1,2,3...
1.
First, create the function block definition including the algorithm and vari-
able definitions in ladder program or ST language. Alternatively, insert a
function block library file that has been prepared in advance.
Note
(a) Create the algorithm entirely with variable names.
(b) When entering the algorithm in ladder programming language,
project files created with versions of CX-Programmer earlier than
Ver. 5.0 can be reused by reading the project file into the CX-Pro-
grammer Ver. 5.0 and copying and pasting useful parts.
2.
When creating the program, insert copies of the completed function block
definition. This step creates instances of the function block.
3.
Enter an instance name for each instance.
4.
Set the variables’ input source addresses and/or constants and output
destination addresses and/or constants as the parameters to pass data for
each instance.
5.
Select the created instance, select
Function Block Memory - Function
Block Memory Allocation
from the
PLC
Menu, and set the internal data
area for each type of variable.
6.
Transfer the program to the CPU Unit.
7.
Start program execution in the CPU Unit and the instance will be called and
executed if their input conditions are ON.
a
b
c
1. Algorithm
2. Variables
Standard
program section
with variable
names a, b, c,
etc.
Table defining usage
and properties of
variables a, b, c, etc.
Input 0.00
Function block definition A
Program
Insert in
program.
Input
condition
The instance is
executed if the input
condition is established.
3. Input instance name
Output 2.00
Output 3.00
Instance of function block definition A
5. The system automatically allocates
the addresses used by these
variables. Set the data area area in
which these addresses are allocated.
4. Specify the input source and
output destination addresses.
Содержание 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...