57
Function Block Applications Guidelines
Section 2-5
2-5-2
Determining Variable Types (Inputs, Outputs, In Out, Externals,
and Internals)
Using Input Variable to
Change Passed Values
To paste a function block into the program and then change the value (not the
address itself) to be passed to the function block for each instance, use an
input variable.
The following two restrictions apply.
• An address can be set in an input parameter, but an address itself cannot
be passed to an input variable (even if an address is set in the input
parameter, the value for the size of the input variable data type is passed
to the function block). Therefore, when the first or last of multiple words is
specified in the instruction operand within the function block, an input vari-
able cannot be used for the operand. Specify either to use internal vari-
ables with AT settings, specify the first or last element in an input-output
array variable (set the input parameter to the first address) (CX-Program-
mer version 7.0 or higher), specify the first or last element in an internal
array variable, or use an external variable (as described in
2-5-4 Array
Settings for Input-Output Variables and Internal Variables
).
• Values are passed in a batch from the input parameters to the input vari-
ables before algorithm execution (not at the same time as the instruction
in the algorithm is executed). Therefore, to pass the value from a parame-
ter to an input variable when the instruction in the function block algorithm
is executed, use an internal variable or external variable instead of an
input variable.
&3
Unit No.
PARA
&50
Program
Instance for function block definition A
The value itself is
passed
Changing the pass value to an input variable.
D00100
DATA_1
W500
XFER
&10
DATA_1
DATA_2
DATA_2
Program
Instance for function block definition A
The actual value is
passed
If the size of the data type in
DATA_1 is 1 word, the value
for the word D00100 is
passed.
If the size of the data type in
DATA_2 is 2 words, the value
for the 2 words W500 and
W501 is passed.
An input variable cannot be used to specify
the address of an operand that specifies
the first (or last) address of multiple words.
For example, the XFER (BLOCK
TRANSFER) instruction cannot be used to
transfer 10 words from the address
beginning with DATA_1 to the address
beginning with DATA_2.
The address can be specified, but the address itself is not passed.
Содержание 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: ......