Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
21 Applied Instructions (Real Time Clock Control)
21.3 TADD / RTC Data Addition
548
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Function and operation explanation
1. 16-bit operation (TADD)
Time data (hour, minute, second) of the device specified by , and time data (hour, minute, second) of the
device specified by are added, and the result is stored in the device specified by .
1) If the operation result exceeds 24 hours, the carry flag is turned ON, and the time by subtracting 24 hours
from the simple sum is stored as the operation result.
2) If the operation result is 0 (0 hour, 0 minute, 0 second), the zero flag is turned ON.
Cautions
1) Number of devices occupied
Three devices are occupied each in , and .
Be careful not to overlap with the devices used in machine control.
2) When using the time (hour, minute, second) of the clock data of the real time clock built in the PLC, first
read out the value of the special data register by using TRD, TRDP, and specify the word device in each
operand.
3) Some restrictions to applicable devices.
S1: The FX
3G, FX3GC, FX3U and FX3UC PLCs only are applicable.
S2: The FX
3U and FX3UC PLCs only are applicable.
Program example
If the operation result exceeds 24 hours
s1 s1 s1 s2 s2 s2
d d d
( , +1, +2)+( , +1, +2)
( , +1, +2)
TADD
EN ENO
d
s1
s2
Command
input
*1
*1
*2
Device for storing the added result of two time data (hour, minute, second)
Device for storing "hour" of addition time data (hour, minute, second)*1.
*2.
+
+1 (minute)
(hour)
+2 (second)
+1 (minute)
(hour)
+2 (second)
+1 (minute)
(hour)
+2 (second)
d
d
d
s1
s1
s1
s2
s2
s2
The range of "hour" is 0 to 23.
The range of "minute" is 0 to 59.
The range of "second" is 0 to 59.
+
+1 30 (minute)
10 (hour)
+2 10 (second)
+1 10 (minute)
3 (hour)
+2 5 (second)
+1 40 (minute)
13 (hour)
+2 15 (second)
10 hours, 30 minutes, 10 seconds 3 hours, 10 minutes, 5 seconds 13 hours, 40 minutes, 15 seconds
s1
s1
s1
d
d
d
s2
s2
s2
[ST]
TADD(X000,D10,D20,D30);
[Structured ladder/FBD]
(D10,D11,D12)+(D20,D21,D22)
(D30,D31,D32)
TADD
EN ENO
d
D30
X000
D10
s1
D20
s2
+
10 (minute)
18 (hour)
30 (second)
20 (minute)
10 (hour)
5 (second)
30 (minute)
4 (hour)
35 (second)
4 hours, 30 minutes, 35 seconds10 hours, 20 minutes, 5 seconds18 hours, 10 minutes, 30 seconds
18+10=28( 24)
s1 s2 d