Example: Analogue Clock
Product: CODESYS Visualization
In the AnalogueClock
example, an analogue clock is implemented and assembled with standard visualization elements. The clock displays the current system time.
![]() |
Description
FB_Clock
: The FB_CLOCK
function block implement the logic for getting current time. First a time zone is set and then the time and date is fetched. Because the units, such as hour, minute, and second) are needed, the date and time variable is split. These parts can be used by the visualization to display the time.
Visualization: The Clock
visualization builds an analogue clock with multiple ellipses and polygons. It is possible to create multiple references to this clock. To do this, a frame has to be added in the main visualization. Right-click the frame and click Frame Selection”. The visualization can be selected there. For the display of the time, a placeholder called FB_CLOCK
” is defined in the interface editor of “Clock_Visu
. This variable is used to animate the clock hands. In order to reference the clock, the variable for the placeholder has to be set in the properties editor at the “References” point. In this way, it is possible to reference multiple clocks (for example, with different time zones).
System requirements and restrictions
Programming system | CODESYS Development System (version 3.5.14.0 or higher) |
Runtime system | CODESYS Control Win (version 3.5.14.0) |
Add-on components | - |
Note
DOWNLOAD Project