Programming Example 2
Use a CTBL (register comparison table) instruction to execute an interrupt process
when the target value is achieved.
Slowing and stopping are executed as interrupt tasks, allowing high-speed
processes to be executed without affecting the cycle time.
Ladder Program
Use a CTBL instruction to execute interrupt tasks when the target position is
reached.
0.02
Start motor
After motor stops, check the stop position.
W0.02
Motor stopped
When the PV of the high-speed counter matches target value 1 (3000), interrupt task
04 will be executed.
Interrupt task
04
>=(325)
<(310)
A270
A270
Normal stop position
#0DDE
#0DAC
>=(325)
A270
Error stop position
#0DDE
P_On
A-4 CP1L Programming Examples
RSET
Reset "motor stopped"
W0.02
A531.00
Software reset for high-speed counter 0
CTBL(882)
#0
Specification for high-speed counter 0
#0
Start comparison with target
D600
Lower CH of comparison table
SET
Set "motor run"
100.00
Stop position is normal if the
100.02
high-speed counter (A270) is between
3500 (0DAC Hex) and 3550 (0DDE Hex).
100.03
Stop position is in error if the
high-speed counter (A270) is
greater than 3550 (0DDE Hex).
SET
Set "motor slow"
100.01
SYSMAC CP1L/CP1E Introduction Manual
A
143
Need help?
Do you have a question about the CP1E - INTRODUCTION and is the answer not in the manual?
Questions and answers