RTC_READ (read real-time clock)

The RTC_READ instruction reads the real-time clock (RTC) module information.
Operation details:
  • Micro810 or L20E controller with embedded RTC:
    • RTCBatLow is always set to zero (0).
    • RTCEnabled is always set to one (1).
  • When the embedded RTC has lost its charge/memory due to loss of power:
    • RTCData is set to 2000/1/1/0/0/0.
    • RTCEnabled is set to one (1).
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
RTC_READ
RTC_READ
RTC_READ parameters
Parameter
Parameter Type
Data Type
Description
Enable
Input
BOOL
Instruction block enable.
  • TRUE: Execute RTC information read.
  • FALSE: There is no read operation and output RTC data is not valid.
RTCData
Output
RTC
RTC data information:
yy/mm/dd, hh/mm/ss, week
.
RTCData output is defined using the RTC data type.
RTCPresent
Output
BOOL
  • TRUE: Free Running clock is utilized or RTC hardware is plugged in.
  • FALSE: Free Running clock is not utilized or RTC hardware is not plugged in.
RTCEnabled
Output
BOOL
  • TRUE: Free Running clock is utilized or RTC hardware is enabled (timing).
  • FALSE: Free Running clock is not utilized, RTC hardware is disabled (not timing).
RTCBatLow
Output
BOOL
  • TRUE: RTC battery is low.
  • FALSE: RTC battery is not low.
ENO
Output
BOOL
Enable output.
Applies only to ladder diagram programs.
RTC data type
Parameter
Parameter Type
Description
Year
UINT
The year setting for the RTC. 16-bit value, and the valid range is from 2000 (Jan 01, 00:00:00) through 2098 (Dec. 31, 23:59:59).
Month
UINT
The month setting for the RTC.
Day
UINT
The day setting for the RTC.
Hour
UINT
The hour setting for the RTC.
Minute
UINT
The minute setting for the RTC.
Second
UINT
The second setting for the RTC.
DayOfWeek
UINT
The day of the week setting for the RTC. This parameter is ignored for RTC_SET.

RTC_READ examples

RTC_READ function block diagram example
RTC_READ function block diagram example
RTC_READ ladder diagram example
RTC_READ ladder diagram example
RTC_READ structured text example
RTC_READ structured text example
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal