6. BASIC INSTRUCTIONS
6
−
71
MELSEC-A
(2) For further information on functions and applications, refer to the use
of subprograms given in the ACPU Programming Manual (Fundamentals).
POINTS
(1) A4U's CHG instruction is used to switch subsequence programs 1, 2, and
3 which are set in the main sequence program.
When up to subsequence program 2 has been set, programs are switched
as the main sequence program
→
subsequence program1
→
subsequence program 2
→
main sequence program.
(2) To switch specified programs, use a ZCHG dedicated instruction.
The AnACPU/AnUCPU Programming Manual (Dedicated Instructions)
gives details of the ZCHG instruction.
Execution
(1) When the A3 is used, the CHG instruction is only executed on the leading edge
Conditions
of its input condition. Since operation result of the input condition changes with
status of M9050, execution contents of the CHG instruction change with status
of
M9050.
Status of M9050
OFF ON
Ladder example
The following program is written before END or FEND of the main and subsequence programs.
Timing chart
OFF
No switching between the main and subsequence
programs. (4), 5), 11))
No switching between the main and subsequence
programs (4), 5), 11))
ON
CHG instruction is executed every scan and switches
between the main and subsequence programs.
(2), 3), 7), 8), 9), 10))
The main sequence program is only switched to the
subsequence program, then back to the main
sequ-ence program on the first leading edge of the
CHG instruction execution command (X0). (2))
Operation
depending on
ON/OFF of
X0
OFF
↓
ON
Switched between the main and subsequence
prog-rams ( 1), 6), 12))
Switched between the main and subsequence
prog-rams ( 1), 6), 12))
Remarks
When the CHG instruction is executed, END processing (e.g. timer timing, counter counting, WDT reset) is
performed for the current program and operation is started from step 0 of the other program.
X0
CHG instruction
execution in main
sequence program
Main sequence
program
Subsequence program
CHG instruction
execution in
subsequence program
1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12)
X0
CHG instruction
execution in main
sequence program
Main sequence
program
Subsequence program
CHG instruction
execution in
subsequence program
1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12)
X000
Inter lock
CHG
Input condition
Main sequence
program
Subsequence
Program 1
Subsequence
Program 2
CHG
CHG
CHG
0
0
0
Summary of Contents for MELSEC-A series
Page 1: ......
Page 2: ......
Page 13: ...A 11 MEMO...
Page 505: ...APPENDICES APP 100 MELSEC A MEMO...
Page 507: ......
Page 508: ......