3 - 48 3 - 48
MELSEC-Q
3 LET'S CREATE AND EXECUTE A PROGRAM
(2) When the contents have to be transferred
The CHAIN instruction is used when the variable used in the program currently
being executed must be transferred to the next program. When all of the used
variables are to be transferred, the ALL option of the CHAIN instruction is used.
The COMMON instruction is used when certain variable contents are to be
transferred.
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 CHAIN " 0:PRO-B" , 10, ALL
SAVE " PRO-A"
OK
RU N
Program A executed!!
A=100
Program B executed!!
A=100
OK
This is an example of all variables being
transferred.
The contents of the
variable have been
transferred.
…………
……
B
All variables
being used.
A
When the ALL option is specified
in the CHAIN instruction
Take them all, OK?
B
Variables
specified
in COMMON.
COMMON
A, B$, C% (1)
A
Just take the variables
specified in COMMON.
When the COMMON instruction is used.
Variables not specified in COMMON.
Variable
contents
Содержание 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...