98
Procedures
Section 3-2
■
Method 1: Using the F Key in the Ladder Section Window and Inputting
the Instance Name
1,2,3...
1.
In the Ladder Section Window, place the cursor in the program where the
instance is to be inserted and press the
F
Key. (Alternately, select
Func-
tion Block Invocation
from the Insert Menu.) The New Function Block In-
vocation Dialog Box will be displayed.
When using ST language, a function block can be called by selecting
“FUNCTION BLOCK” as the variable’s data type, using the desired in-
stance name, and entering the following function block call statement.
Specify arguments in parentheses after the instance name (to pass input
variable values from the calling function block to input variables in the
called function block) and also specify return values (to receive output vari-
able values from the called function block to output variables in the calling
function block). The instance name can be set to any internal variable with
the “FUNCTION BLOCK” data type.
2.
Input the instance name, select the function block from which to create an
instance, and click the
OK
Button.
3.
As an example, set the instance name in the
FB Instance
Field to
sample
,
set the function block in the
FB Definition
Field to
FunctionBlock1
, and
click the
OK
Button. As shown below, a copy of the function block definition
called
FunctionBlock1
will be created with an instance name of
sample.
The instance will be automatically registered in the global symbol table
with an instance name of
sample
and a data type of
FUNCTION BLOCK.
■
Method 2: Registering the Instance Name in the Global Symbol Table in
Advance and Then Selecting the Instance Name
If the instance name is registered in the global symbol table in advance, the
instance name can be selected from the global symbol table to create other
instances.
Press
F
Key with cursor here.
Input the instance name.
Select the function block from
which to create an instance.
Following dialog
box is displayed.
Instance name
Function block definition
An instance called
sample
is created from the function
block definition called
FunctionBlock1.
Содержание SYSMAC CX-Programmer 9
Страница 2: ......
Страница 4: ...iv ...
Страница 6: ...vi ...
Страница 8: ......
Страница 16: ...xvi ...
Страница 20: ...xx ...
Страница 26: ...xxvi Application Precautions 4 ...
Страница 27: ...Part 1 Function Blocks ...
Страница 28: ......
Страница 154: ...128 Procedures Section 3 2 ...
Страница 155: ...Part 2 Structured Text ST ...
Страница 156: ......
Страница 160: ...134 CX Programmer Specifications Section 4 2 ...
Страница 206: ...180 Procedures Section 6 1 ...
Страница 208: ...182 System defined external variables supported in function blocks Appendix A ...
Страница 230: ...204 Revision History ...
Страница 231: ......