![background image](http://html1.mh-extra.com/html/omron/cs1-h-series/cs1-h-series_operation-manual_742526132.webp)
117
Procedures
Section 3-2
Note
Function block definitions are not displayed in the default settings for OMRON
FB Library files (.cxf). To display definitions, select the
Display the inside of
FB
option in the function block properties. (Select the OMRON FB Library file
in the project workspace, right-click, select
Properties
,
and select the
Dis-
play the inside of FB
option in the General Tab.)
3-2-3
Defining Function Blocks Created by User
A function block is defined by registering variables and creating an algorithm.
There are two ways to do this.
• Register the variables first and then input the ladder program or structure
text.
• Register variables as they are required while inputting input the ladder
program or structure text.
Registering Variables First
Registering Variables in
the Variable Table
The variables are divided by type into four sheets in the variable table: Inter-
nals, Inputs, Outputs, and Externals.
These sheets must be switched while registering or displaying the variables.
1,2,3...
1.
Make the sheet for the type of variable to be registered active in the vari-
able table. (See note.) Place the cursor in the sheet, right-click, and per-
form either of the following operations:
• To add a variable to the last line, select
Insert Variable
from the popup
menu.
• To add the variable to the line above or below a line within the list, se-
lect
Insert Variable - Above
or
Below
from the popup menu.
Note
The sheet where a variable is registered can also be switched
when inserting a variable by setting the usage (N: Internals, I: In-
puts, O: Outputs, E: Externals).
The New Variable Dialog Box shown below will be displayed.
•
Name:
Input the name of the variable.
•
Data Type:
Select the data type.
•
Usage:
Select the variable type.
•
Initial Value:
Select the initial value of the variable at the start of oper-
ation.
•
Retain:
Select if the value of the variable is to be maintained when the
power is turned ON or when the operating mode is changed from
PROGRAM or MONITOR mode to RUN mode. The value will be
cleared at these times if
Retain
is not selected.
Variable table
Ladder program
Содержание 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...