59
Function Block Applications Guidelines
Section 2-5
External Variables:
Condition Flags, Clock
Pulses, Auxiliary Area
Bits, Global Symbols in
Program
Condition Flags (e.g., Always ON Flag, Equals Flag), Clock Pulses (e.g., 1.0
second clock pulse bit), pre-registered Auxiliary Area Bits (e.g., First Cycle
Flag), and global symbols used in the program are all external variables
defined by the system.
Internal Variables:
Internally Allocated
Variables and Variables
Requiring AT Settings
Variables that are not specified as Inputs, Outputs, In Out, or Externals are
Internals. Internal variables include variables with internally allocated
addresses and variables requiring addresses with AT settings (e.g., I/O alloca-
tion addresses, addresses specially allocated for Special I/O Units). Variables
requiring array settings include input-output variables and internal variables.
For details on conditions requiring AT settings or array settings, refer to
2-5-3
AT Settings for Internal Variables
, and
2-5-4 Array Settings for Input-Output
Variables and Internal Variables
.
2-5-3
AT Settings for Internal Variables
Always specify AT settings for internal variables under the following condi-
tions.
• When addresses allocated to Basic I/O Units, Special I/O Units, or CPU
Bus Units are used and these addresses are registered to global symbols
that cannot be specified as external variables (e.g., data set for global
symbols is unstable).
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-5-5 Specify-
ing 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 an array variable cannot be specified for the operand (e.g., the num-
ber of array elements cannot be specified).
2-5-4
Array Settings for Input-Output Variables and 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-6 Precautions for Instructions with Operands Specifying
the First or Last of Multiple Words
. Use the following method to specify an array
variable.
When using input-output variables, set the input parameter to the first address
of multiple words.
Use the following procedure for internal variables.
1,2,3...
1.
Prepare an internal array variable with the required number of elements.
Содержание 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: ......