3 - 47 3 - 47
MELSEC-Q
3 LET'S CREATE AND EXECUTE A PROGRAM
3.15 Executing a Large Program by Dividing it up
A large program that doesn't fit into memory cannot be executed. However, if a large
program can be divided and saved into smaller programs and then executed one by
one, it is possible to yield the same result of running one large program.
It is possible in AD51H-BASIC to execute a program that has been divided up by using
the following procedure.
1. When the variable contents do not
have to be transferred
• • • • • • • • • The LOAD and RUN
instructions are used.
2. When the contents have to be
transferred
• • • • • • • • • The CHAIN instruction is
used.
3. When a portion of the program is
shared
• • • • • • • • • The CHAIN instruction is
used.
(1) When the variable contents do not have to be transferred
When there is no need to transfer the contents of variables that are used in the
current program to the next program, use the RUN "Program Name" instruction
or the R option in the LOAD instruction to execute the new program.
10 PRINT "Program B executed!!"
20 PRINT " A=" ;A
30 END
SAVE " PRO-B"
OK
NEW
OK
10 PRINT "Program A executed!!"
20 A=100
30 PRINT " A=" ;A
40 RUN " 0:PRO-B"
SAVE " PRO-A"
OK
RU N
Program A executed!!
A= 100
Program B executed!!
A= 0
OK
LOAD " 0:PRO- B" Same as LOAD "0:PRO-B",R.
The content of the
variable is not
transferred.
…………
……
Variable
contents
B
A
I'm not going to give you
the variable.
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...