11 - 18 11 - 18
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
CHAIN
Instruction
CHAIN
• Erases or partly deletes the program that is currently being executed, and reads and
executes the specified program.
CHAIN ”[<drive number>:] [<system name> \] <file name>”
[, <line number1> :] [, ALL]
CHAIN MERGE ” [<drive number>:] [<system name> \] <file name>” [, <line number 1> :]
[, ALL] [, DELETE <line number 2> - <line number 3>]
drive number
• • • •
Specify the memory card or FD where the program
to be read is stored.
system name
• • • •
Specify the system name where the program to be
read is stored.
file name
• • • •
Specify the file name of a program to be read.
line number 1
• • • •
Specify the execution starting line of the program.
line number 2
• • • •
Specify the area to be deleted by the DELETE
option.
Syntax
line number 3
• • • •
Specify the area to be deleted by the DELETE
option.
CHAIN “0:PRGM-A”
• • • •
Erases the current program and reads the program
stored in the “PRGM-A.BAS” file from the memory
card inserted in the M-CARD0. Then, executes the
program after handing over the variables specified
by the COMMON instruction.
CHAIN “1:PRGM-A”, 200,
ALL
• • • •
Erases the current program and reads the program
written in the “PRGM-A.BAS” file of “1”. Then, hands
over all variables, etc., and starts executing from line
number 200 of the program just read.
CHAIN MERGE “A:SUB-A”,
DELETE 1000-2000
• • • •
Erases line number 1000 through 2000 of the current
program and reads the program written in the “SAB-
A.BAS” file of “0.” Then, merges them into one
program and starts executing from line number 1000.
Examples
CHAIN MERGE, “0:TEST”,
1000, DELETE 1000-1500
• • • •
Erases line number 1000 through 1500 of the current
program and reads the program written in the
“TEST.BAS” file of “0.” Then, merge them into one
program and starts executing from line number 1000.