Non-real-time testing and simulation - how to use the “warp clock”

What is the “warp clock”?

Many actuators, aggregates, or algorithms in the building automation field are related to time. Most of them tend to have long time constants, low sampling rates, and other “slow” behaviors. Therefore, real-time testing and simulation is not a good solution. As a library or application developer, it’s best to have control on the time axis if needed - for testing or simulation. The WarpClock provides such a control on the time axis. It allows for the following:

  • Run the clock in real time UTC

  • Run the clock with a given “warp” factor

  • Start at a specific start time - regardless whether UTC or local

  • Reset time to a specific (start) time

  • Step forward in time by a given increment

How to use the “warp clock”?

Function blocks in the CODESYS Building Automation library related to time always provide an itfDateTimeProvider input, by default connected to a time provider running in real time (implementing Util.IDateTimeProvider). To do non-real-time testing or a simulation, connect itfDateTimeProvider to a WarpClock instead, and take over control on the time axis by using the WarpClock features.