i need help creating a digital clock in CODESYS that should be displyed on a Raspberry Pi LCD Display trough the Visualization built in CODESYS. I have an idea how to display the time by making a 7 Segment Dysplay in the Visu. But I don't know how to get the actual time into the program. Can anyone help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To display the current time, youβll need to retrieve it from the system clock. In CODESYS, you can use the built-in function SysTime to get the current system time.
Hereβs an example of how you can use it:
VAR
dtCurrentTime: DATE_AND_TIME;
sTime: STRING(8);
END_VAR
i need help creating a digital clock in CODESYS that should be displyed on a Raspberry Pi LCD Display trough the Visualization built in CODESYS. I have an idea how to display the time by making a 7 Segment Dysplay in the Visu. But I don't know how to get the actual time into the program. Can anyone help?
To display the current time, youβll need to retrieve it from the system clock. In CODESYS, you can use the built-in function SysTime to get the current system time.
Hereβs an example of how you can use it:
The sTime variable now contains the current time in the format βHH:MM:SSuno online".
Last edit: evanclegg 2024-02-28