OperationalTime (FB)¶
FUNCTION_BLOCK OperationalTime
“warp clock”-enabled operational time (counter). Accumulates the time a device is in operation - connect the “operational” information to xInput. OperationalTime starts to accumulate operational time if xInput is TRUE and was TRUE in the cycle before. OperationalTime stops to accumulate operational time if xInput is FALSE. The operational time can be made persistent using the CODESYS PersistenceManager taking care for the group ‘BuildingLib_OperationalTime’.
“Warp clock”-enabled¶
Certain application domains base their functionality / algorithms on real world wall clock date/time. To develop such functionality it is helpful to have control over the application timeline to speedup testing or doesnt loose control on the timeline sitting on breakpoints. WarpClock and “warp clock”-enabled function blocks provides such a control if needed. For more details about “warp” time see WarpClock.
To use “warp” time connect an accordingly configured WarpClock to itfDateTimeProvider.
- InOut:
Scope
Name
Type
Initial
Comment
Input
xInputBOOLFALSE
Input to operational time on.
xInitBOOLFALSE
Initialize the operational time with a given value (tInit).
tInitLTIMELTIME#0ns
Initialization value
xResetBOOLFALSE
Reset the operational time
itfDateTimeProviderUtil.IDateTimeProviderGlobals.g_dtpDateTimeProvider
Source for the current date and time information in milliseconds since 1.1.1970 00:00:00.000
Output
tOpLTIMEOperational time
xErrorBOOLError indication
eErrorIDError ID