99
Procedures
Section 3-2
1,2,3...
1.
For a ladder diagram, select a data type of
Function block
in the global
symbol table, input the instance name, and registered the instance.
For ST, select a data type of
Function block
, use the instance name, and
use a call statement for the function block as follows to call the function
block:
Input the instance name (any internal variable name with a function block
data type) followed by the arguments in parentheses (i.e., specify the input
variable values of the calling function block to pass to the input variables of
the called function block). Also include the return values (i.e., specify the
output variable values of the called function block to pass back to the out-
put variables of the calling function block).
2.
Press the
F
Key in the Ladder Section Window. The Function Block Invo-
cation Dialog Box will be displayed.
3.
Select the instance name that was previously registered from the pulldown
menu on the
FB Instance
Field. The instance will be created.
Restrictions
Observe the following restrictions when creating instances. Refer to
2-4 Pro-
gramming Restrictions
for details.
• No more than one function block can be created in each program circuit.
• The rung cannot be branched to the left of an instance.
• Instances cannot be connected directly to the left bus bar, i.e., an EN
must always be inserted.
Note
If changes are made in the I/O variables in a variable table for a function block
definition, the bus bar to the left of all instances that have been created from
that function block definition will be displayed in red to indicate an error. When
this happens, select the function block, right-click, and select
Update Invoca-
tion
. The instance will be updated for any changes that have been made in
the function block definition and the red bus bar display indicating an error will
be cleared.
3-2-5
Setting Function Block Parameters Using the Enter Key
After an instance of a function block has been created, input parameters must
be set for input variables and output parameters must be set for output vari-
ables to enable external I/O.
• Values, addresses, and program symbols (global symbols and local sym-
bols) can be set in input parameters. (See note a.)
• Addresses and program symbols (global symbols and local symbols) can
be set in output parameters. (See note b.)
Note
(a) The function block’s input variable data size and the program’s
symbol data size must match.
(b) The function block’s output variable data size and the program’s
symbol data size must match.
1,2,3...
1.
Inputs are located on the left of the instance and outputs on the right. Place
the cursor where the parameter is to be set and press the
Enter
Key. (Al-
ternately, select
Function Block Parameter
from the Insert Menu.) The
New Parameter Dialog Box will be displayed as shown below.
Содержание CX-PROGRAMMER V8.1
Страница 3: ...iv...
Страница 5: ...vi...
Страница 7: ......
Страница 15: ...xvi...
Страница 19: ...xx...
Страница 25: ...xxvi Application Precautions 4...
Страница 26: ...Part 1 Function Blocks...
Страница 27: ......
Страница 153: ...128 Procedures Section 3 2...
Страница 154: ...Part 2 Structured Text ST...
Страница 155: ......
Страница 159: ...134 CX Programmer Specifications Section 4 2...
Страница 205: ...180 Procedures Section 6 1...
Страница 207: ...182 System defined external variables supported in function blocks Appendix A...
Страница 229: ...204 Revision History...
Страница 230: ......