RTC_SET (set real-time clock)

The RTC_SET instruction sets RTC (real-time clock) data to the RTC module information.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
RTC_SET
RTC_SET
RTC_SET parameters
Parameter
Parameter Type
Data Type
Description
Enable
Input
BOOL
Instruction block enable.
  • TRUE: Execute RTC_SET with the RTC information from input. Typically, only execute for 1 program scan when updating the RTC.
  • FALSE: Do not execute RTC_SET. Set to FALSE to operate RTC normally.
RTCEnable
Input
BOOL
  • TRUE: To enable RTC with the RTC data specified.
  • FALSE: To disable RTC.
RTCData
Input
RTC
RTC data information:
yy/mm/dd, hh/mm/ss, week
as defined in the RTC data type.
RTCData is ignored when RTCEnable = 0.
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, or RTC hardware is disabled (not timing).
RTCBatLow
Output
BOOL
  • TRUE: RTC battery is low.
  • FALSE: RTC battery is not low.
Sts
Output
USINT
The read operation status.
RTC_Set status (Sts) values:
  • 0x00: Function block not enabled (no operation).
  • 0x01: RTC set operation success.
  • 0x02: RTC set operation fails.
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_SET examples

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