VisualHMI time control: RTC display/editing, 12/24-hour format and clock

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

The time control supports two forms:RTC numerical format(YYYY-MM-DD HH:MM:SS) andclock(hour/minute/second hands). It supports MCU synchronous calibration and user-click editing.

1. Time Synchronization Mechanism

  • MCU Synchronization: The main control calibrates the time by reading and writing dedicated registers (year/month/day/hour/minute/second) of the HMI
  • User Editing: In editable mode, clicking pops up a keyboard/date picker, and after modification, it is written back to the register

VisualHMI time control: RTC display/editing, 12/24-hour format and clock插图

The time remains accurate after the physical screen is powered off, requiring the PCB to have an RTC circuit + sufficient battery power; the virtual screen time = the current time on the computer and is not supported for modification. If the "time keeps resetting" on site, check the battery first.

2. RTC Control Properties

2.1 Display Attributes

AttributesDescription
DateYYYY/MM/DD, MM/DD/YYYY, DD/MM/YYYY or not displayed
Day of WeekDisplay or not displayed
TimeHH:MM or HH:MM:SS
12-hour formatAfter checking, the afternoon starts from 1 PM (display AM/PM)
Set TimeLong press for 3 seconds to enter / Click to enter / Disable
modeTime and Date / Time / Date
Keyboard Screen / PositionDefault 100_digit320&240; Click here or customize
Enable Multi-LanguageMulti-Language for weekday and other texts
Use TimestampUnchecked = System RTC Time; Checked = Timestamp Variable Address (4-byte Timestamp)

VisualHMI time control: RTC display/editing, 12/24-hour format and clock插图1

2.2 Font Attributes

Font / Font Size / Color / Horizontal Alignment (Left / Center / Right).

VisualHMI time control: RTC display/editing, 12/24-hour format and clock插图2

3. Clock Control Attributes

  • Hands: Hour/Minute/Second Hands
  • Hand Image Library: Hand Images
  • Rotation Center X/Y: Hand Rotation Position, where X is generally half the width of the image and Y is the height.

VisualHMI time control: RTC display/editing, 12/24-hour format and clock插图3

4. Application Cases

4.1 RTC 12/24 Hour Switching

3 RTCs: Year/Month/Day + Weekday (long press for 3 seconds to edit, Chinese weekday); 12-hour format (HH:MM:SS, display AM on the right side, condition LW1001==1); 24-hour format (condition LW1001==0). The additional status indicator light (toggle switch, LW1001) controls which one is displayed.

VisualHMI time control: RTC display/editing, 12/24-hour format and clock插图4

VisualHMI time control: RTC display/editing, 12/24-hour format and clock插图5

VisualHMI time control: RTC display/editing, 12/24-hour format and clock插图6

4.2 Clock

3 clock controls (hour/minute/second hands), each associated with a hand image library, with the rotation center set according to the image size (second hand image X=2, Y=130). After running, it is consistent with the computer time.

VisualHMI time control: RTC display/editing, 12/24-hour format and clock插图7

VisualHMI time control: RTC display/editing, 12/24-hour format and clock插图8

Clock Rotation Center: X is generally half the width of the image, Y is the height of the image - the hands rotate around the bottom center. If X/Y is set incorrectly, the hands will "float" on the dial.

Compiled from the VisualHMI development documentation of Guangzhou Dacai Technology (hmi-doc.gz-dc.com), the configuration control tutorial "Time", copyright reserved by Dacai Technology.

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.