11 - 31 11 - 31
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
COMMON
Instruction
COMMON
• Sets variable and others to be passed to the program to be executed by the CHAIN
instruction.
COMMON <data to be passed> [, <<data to be passed >, … ]
Syntax
data to be passed
• • • •
Specify a variable or array that is passed to the
program to be executed by the CHAIN instruction.
Examples
COMMON A$, B%( )
• • • •
Passes A$ and all elements of array B% to the
program to be executed by the CHAIN instruction.
Description
• The COMMON instruction specifies variables or arrays to be passed to the program that
will be executed by the CHAIN instruction.
• In <data to be passed>, specify variables and others to be passed to the program that is
read by the CHAIN instruction.
• To specify an array, write only parentheses after the array name.
A%( ), B#( ), C$( )
• If there is an error in the COMMON instruction, an error occurs when the CHAIN instruction
is executed.
• To pass all variables and arrays, specify the ALL option in the CHAIN instruction.
• When <data to be passed> is specified in the COMMON instruction and the ALL option is
specified in the CHAIN instruction, everything is passed regardless of the <data to be
passed> specification in the COMMON instruction.
REMARK
• The COMMON instruction is valid even if it is described in a part of a program.
• Write the COMMON instruction in the program that executes the CHAIN
instruction.
• See the CHAIN instruction.