
2.4 Instruction Details
3-142
2
Chapter 2 Instructions
■ Transferring the current counter value to data memory (DM)
Coding
Description
In step
a), the C010 current value is transferred via the internal register and stored
into DM0000, throughout the operation.
■ Transferring the contents of data memory as a setting value for a timer
Coding
Description
• In step
a), contents of DM0010 is transferred to T002 via the internal register for
use as the T002 preset value, when 0002 is ON.
• In step b), contents of DM0011 is transferred to T002 via the internal register for
use as the T002 preset value, when 0002 is OFF.
• Although the preset value of T002 is #00010 in the above example, any value
except #00000 can be given because the preset value is changed to the speci-
fied value by turning ON/OFF 0002. Once the counter value has been changed,
the changed value will be stored until it is changed again.
• The setting values of timers and counters are reset to the original setting values
after the power is turned OFF once and then ON again.
Note 1: If an STA instruction is executed when the current value is larger than the
preset value, the current value will be changed to the preset value.
Note 2: Do not change the setting value of T002 to "#00000".
The C010 current value is transferred to DM0000.
0001
2002
C010
LDA
DM0000
STA
#09999
C010
0000
a)
Line No. Instruction Operand
0000 LDB 0001
0001 C 010 #099999 0000
0002 LD 2002
0003 LDA C010
0004 CON
0005 STA DM0000
0002
T002 0500
b)
DM0010
LDA
T002
STA
0002
0003
DM0011
LDA
T002
STA
#00010
T002
a)
Line No. Instruction Operand Line No. Instruction Operand
0000 LD 0002 0007 STA T0002
0001 LDA DM0010 0008 LD 0003
0002 CON 0009 TMR 002 #00010
0003 STA T002 0010 CON
0004 LDB 0002 0011 AND T002
0005 LDA DM0011 0012 OUT 0500
0006 CON
LDA / @LDA / STA @STA
KVNKA Chap 02_4cP.p65 08.3.11, 0:02 PM142
Comentarios a estos manuales