Determining Variable Types (Inputs, Outputs, In Out, Externals, And Internals) - Omron CX-PROGRAMMER V8.1 Operation Manual

Function blocks/ structured text
Table of Contents

Advertisement

Function Block Applications Guidelines
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.
Program
Instance for function block definition A
The value itself is
passed
&3
Unit No.
&50
PARA
Changing the pass value to 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).
Program
Instance for function block definition A
The actual value is
passed
D00100
DATA_1
W500
DATA_2
The address can be specified, but the address itself is not passed.
• 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.
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
If the size of the data type in
transfer 10 words from the address
DATA_1 is 1 word, the value
beginning with DATA_1 to the address
for the word D00100 is
beginning with DATA_2.
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.
Section 2-5
XFER
&10
DATA_1
DATA_2
57

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac ws02-cxpc1-v8Sysmac cx-programmer 8.1

Table of Contents