44
Function Block Applications Guidelines
Section 2-4
Note
The method for specifying Index Registers for Special I/O Unit allo-
cation addresses requires AT settings to be specified for the first
address of the allocation area. (For details, refer to
2-4-5 Specifying
Addresses Allocated to Special I/O Units
.)
• When Auxiliary Area bits that are not pre-registered to external variables
are used, and these bits are registered to global symbols that are not
specified as external variables.
• When setting the first destination word at the remote node for SEND(090)
and the first source word at the local node for RECV(098).
• When the instruction operand specifies the first or last of multiple words,
and internal array variable cannot be specified for the operand (e.g., the
number of array elements cannot be specified).
2-4-4
Array Settings for Internal Variables
Using Array Variables
to Specify First or Last
Word in Multiword
Operands
When specifying the first or last of a range of words in an instruction operand
(see note), the instruction operates according to the address after AT specifi-
cation or internal allocation. (Therefore, the variable data type and number of
elements for the variable are unrelated to the operation of the instruction.) Al-
ways specify a variable with an AT setting or an array variable with a number
of elements that matches the data size to be processed by the instruction.
Note
Some examples are the first source word or first destination word of the
XFER(070) (BLOCK TRANSFER) instruction, the first source word for
SEND(090), or control data for applicable instructions.
For details, refer to
2-5 Precautions for Instructions with Operands Specifying
the First or Last of Multiple Words
. Use the following method to specify an array
variable.
1,2,3...
1.
Prepare an internal array variable with the required number of elements.
Note
Make sure that the data size to be processed by the instruction is
the same as the number of elements. For details on the data sizes
processed by each instruction, refer to
2-6 Instruction Support and
Operand Restrictions.
2.
Set the data in each of the array elements using the MOV instruction in the
function block definition.
3.
Specify the first (or last) element of the array variable for the operand. This
enables specification of the first (or last) address in a range of words.
Examples are provided below.
Handling a Single String of Data in Multiple Words
In this example, an array contains the directory and filename (operand S2) for
an FREAD instruction.
• Variable table
Internal variable, data type = WORD, array setting with 10 elements, vari-
able names = filename[0] to filename[9]
• Ladder programming
Set data in each array element.
Specify the first element
of the array in the instruction
operand.
FREAD (
omitted
) (
omitted
) file_name[0] (
omitted
)
MOV #0000 file_name[2])
MOV #3233 file_name[1]
MOV #5C31 file_name[0]
Содержание 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...