3 - 49 3 - 49
MELSEC-Q
3 LET'S CREATE AND EXECUTE A PROGRAM
(3) When a portion of the program is shared
The MERGE and DELETE options of the CHAIN instruction are used when a
certain portion of the current program is to be switched with another program.
70 PRINT "Program B executed!!"
80 A=4:GOSUB 1000
90 END
SAVE " PRO-B"
OK
NEW
OK
10 PRINT "Program A executed!!"
20 A=7:B=3:GOSUB 1000
30 CHAIN MERGE " 0:PRO-B" , 70, ALL, DELETE 10-30
1000 PRINT " A=" ;A
1010 PRINT " B=" ;B
1020 RETURN
SAVE " PRO-A"
OK
RU N
Program A executed!!
A= 7
B= 3
Program B executed!!
A= 4
B= 3
OK
LIST
70 PRINT "Program B executed!!"
80 A=4:GOSUB 1000
90 END
1000 PRINT " A=" ;A
1010 PRINT " B=" ;B
1020 RETURN
OK
Lines 90 through 30 of the
current program will be
deleted and the "PRO-B.BAS"
program will be added.
…………
Contents of "PRO-B.BAS"
The original program
contents
A
10
20
30
60
10
20
30
60
A
40
50
DELETE
option
MERGE
option
I'll erase this part since
I don't need it.
I'll add this.
The transfer of variable contents using the ALL option and COMMON
instruction can be used even when the DELETE and MERGE options
are used in the CHAIN instruction.
Содержание 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...