Справочник Пользователя для Mitsubishi Electronics FX2NC

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-139
5.14.5
TRD (FNC 166)
Contents:
The current time and date of the real time clock are
read and stored in the 7 data devices specified by
the head address D.
The 7 devices are set as follows:
Points to note:
The year is read as a two digit number. This can be change to a 4 digit number by setting
D8018 to 2000 during the first program scan; see following program extract.
Mnemonic
Function 
Operands
Program steps
D
TRD
FNC 166
(Time
Read)
Reads the current
value of the real
time clock to a
group of registers
T, C, D
Note: 7 consecutive devices are used.
TRD, TRDP:
5 steps
Device
Meaning
Values
Device
Meaning
D8018
Year
00-99
D
+0
Year
D8017
Month
01-12
D
+1
Month
D8016
Date
01-31
D
+2
Date
D8015
Hours
00-23
D
+3
Hours
D8014
Minutes
00-59
D
+4
Minutes
D8013
Seconds
00-59
D
+5
Seconds
D8019
Day
0-6 (Sun-Sat)
D
+6
Day
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
M34
D12
TRD
[ D ]
M8002
K2000 D8018
MOV
If this is done then the clock year should not be used during the first scan as it will be a two
digit number before the instruction and a value of 2000 after the instruction until the END
instruction executes. After the first scan the year is read and written as a 4 digit number.
The FX-10DU-E, FX-20DU-E and FX-25DU-E only support a 2 digit year.