CTime (FB)

FUNCTION_BLOCK CTime

Short Description

Convertion of a time-input (Dataype: UDINT) into a time-output (Dataype: TIME). The scaling for the time input can be selected. Automatic calculation of min / max limits for input values.


Portrayal

../_images/CTime_FB.png

Interfaces

Inputs

Outputs

Name

Datatype

Range

Init-Value

Function

tOutTime TIME 0 ... 4294967295ms  

Timevalue (Datatype: TIME)

udiMinVisu UDINT    

Display of tMinTime for visualization

udiMaxVisu UDINT    

Display of tMaxTime for visualization

Setpoints / Parameters

Name

Datatype

Range

Init-Value

Function

udiTime UDINT 0 ... 4294967295  

Timevalue (Limit: 0..7 Days) depending on scaling

eTimeScale eZeit

Seconds, Minutes, Hours

eZeit.Sekunden

Commitment of the scaling of the time-input (seconds, minutes, hours)

tMinTime TIME 0 ... 4294967295ms 0s

Lower limit for the time-input udiTime

tMaxTime TIME 0 ... 4294967295ms 2h

Upper limit for the time-input udiTime

Functional Description

General

This function block is used to convert a time-input udiTime into a time-output tOutTime.
The scaling for the time-input udiTime takes place via the setpoint and parameter eTimeScale.
The time-input is absolutely limited to a value range of 0...7 days.
The time-input is limited by a lower limit tMinTime and an upper limit tMaxTime, both limits are also subject to scaling.
The time-output tOutTime is accordingly limited to the range tMinTime - tMaxTime.
If the lower limit tMinTime exceeds the upper limit tMaxTime, the lower limit tMinTime is reduced to the upper limit.
Dieser Baustein kann z.B. für die Eingabe in einer Visualisierung genutzt werden.

Visualization




Information

Element

Authors

Datum Version

Note

Function

Adam Bartod 04.2016 1.0

Initial version

Programming

Adam Bartod 04.2016 1.0

Initial version

Test Jochen Reu / 06.2016 1.0

Initial version

Documentation

Jochen Reu 10.2017 1.0

Initial version

Documentation

Lukas Pfänder 11.2017 0.1.3.0 Revision

Codesys

InOut:
Scope Name Type Initial Comment
Input tMaxTime TIME TIME#120m0s0ms

Upper limit for the time-input udiTime

tMinTime TIME TIME#0ms

Lower limit for the time-input udiTime

eTimeScale eTime eTime.Second

Commitment of the scaling of the time-input (seconds, minutes, hours)

udiTime UDINT  

Timevalue (Limit: 0..7 Days) depending on scaling

Output tOutTime TIME  

Timevalue (Datatype: TIME)

udiMinVisu UDINT  

Display of tMinTime for visualization

udiMaxVisu UDINT  

Display of tMaxTime for visualization