FP
Σ
User's Manual
3.6 Clock/Calendar Function
39
ST Body
if
(
DF
(
bStartCompensation
))
then
(* Read the current time from the RTC *)
dtbcdCurrent
.
MinSec
:=
sys_wClockCalendarMinSec
;
dtbcdCurrent
.
DayHour
:=
sys_wClockCalendarDayHour
;
dtbcdCurrent
.
YearMonth
:=
sys_wClockCalendarYearMonth
;
(* Decide whether to round up (seconds>=30) *)
if
((
dtbcdCurrent
.
MinSec
AND
16#00FF
)>
30
)
then
(* To round up 1 minute (16#100) is added to the current
time *)
F157_ADD_DTBCD_TIMEBCD
(
s1_DTBCD
:=
dtbcdCurrent
,
s2_TIMEBCD
:=
16#100
,
d_DTBCD
=>
dtbcdCurrent
);
end_if
;
(* Set the seconds to zero *)
dtbcdCurrent
.
MinSec
:=
dtbcdCurrent
.
MinSec
AND
16#FF00
;
(* Write the current time into the RTC and set the RTC using
'sys_wClockCalendarSet' *)
sys_wClockCalendarMinSec
:=
dtbcdCurrent
.
MinSec
;
sys_wClockCalendarDayHour
:=
dtbcdCurrent
.
DayHour
;
sys_wClockCalendarYearMonth
:=
dtbcdCurrent
.
YearMonth
;
sys_wClockCalendarSet
:=
16#8000
;
end_if
;
Summary of Contents for AFPG951T34
Page 7: ......
Page 17: ......
Page 18: ...Chapter 1 Safety Measures ...
Page 21: ......
Page 22: ...Chapter 2 Overview ...
Page 32: ...Chapter 3 CPU Types ...
Page 47: ...CPU Types FPΣ User s Manual 30 LD Body ...
Page 51: ...CPU Types FPΣ User s Manual 34 POU Header and LD Body ...
Page 55: ...CPU Types FPΣ User s Manual 38 LD Body ...
Page 57: ......
Page 58: ...Chapter 4 Expansion ...
Page 73: ......
Page 74: ...Chapter 5 I O Allocation ...
Page 81: ......
Page 82: ...Chapter 6 Installation and Wiring ...
Page 115: ......
Page 116: ...Chapter 7 High Speed Counter and Pulse Output ...
Page 169: ......
Page 170: ...Chapter 8 Communication ...
Page 227: ...Communication FPΣ User s Manual 210 LD Body ST Body ...
Page 233: ...Communication FPΣ User s Manual 216 POU Header LD Body ...
Page 236: ...FPΣ User s Manual 8 6 Program Controlled Communication 219 POU Header LD Body 1 2 ...
Page 237: ...Communication FPΣ User s Manual 220 2 2 ST Body ...
Page 266: ...Chapter 9 Security Functions ...
Page 273: ......
Page 274: ...Chapter 10 Other Functions ...
Page 277: ......
Page 278: ...Chapter 11 Troubleshooting ...
Page 289: ......
Page 290: ...Chapter 12 Appendix ...