Control digital output (%QX0.x) at specific times

Hi,

I (newbie) am looking for a simple way in eCockpit using structured text to read the system time and switch a digital output (DO) every 3 hours at specific times.
I’ve read several forum posts regarding GetLocalTime and similar calls, but I can neither follow nor copy them because something always seems to be missing. Could one of you please guide me step by step and explain the tricky parts?
I’m using a WAGO PFC200 8212, Codesys V3.5 SP16 Patch 3, Compiler 3.5.16.32.

Thanks in advance!

Hi,

with WagoAppTime Library you should be able to retrieve the Systemtime from the Controller.

Result is the DT Datatype.

to create a Signal every 3 Hours you could use several ways to evaluate timestamps.

for example Evaluate Difference between Timestamps

due to your needs you can also use WagoAppScheduler.
There are many options for Scheduler Functions to use within the Controllers.

For Example. Use the FbScheduler with Multiple typSpecialPeriod Configurations every 3 Hours.