[CMPTIDAY] Compare time of day

Function block CMPTIDAY compares two values of data type TimeOfDay.

CMP_TIDAY compares two values of data type TimeOfDay and provides the logical results for In1 greater than In2, In1 greater than or equal to In2, In1 equals In2, In1 less than or equal to In2 and In1 less than In2 to the outputs.

CMPTIDAY provides the time difference between the values at In1 and In2 at output [DTi]. The result of the time difference is limited to the range of the data type at the output.

Pins

Input

Description

Data type

Default value
Value range

In1In2

Input 1Input 2

TimeOfDay

00:00:00.000

 

Output

Description

Data type

Default value
Value range

Gt

In1 greater than In2

Boolean

0

0 - In1 is less than or equal to In2.
1 - In1 is greater than In2.

Ge

In1 greater or equal to In2

Boolean

0

0 - In1 is less than In2.
1 - In1 is greater than or equal to In2.

Eq

In1 equals In2

Boolean

0

0 - In1 is not equal to In2.
1 - In1 is equal to In2.

Le

In1 less than or equal to In2

Boolean

0

0 - In1 is greater than In2.
1 - In1 is less than or equal to In2.

Lt

In1 less than In2

Boolean

0

0 - In1 is greater than or equal to In2.
1 - In1 is less than In2.

GeTrg

Greater or equal trigger

Triggers a pulse when In1 is greater than or equal to In2.

Boolean

0

DTi

Delta time

Time

0 ms

Application example

Output [GeTrg] can be used to compare the preset system time from the automation station with a configured time at input [In2] and trigger a pulse if the current system time reaches the time at input [In2]. Interconnect the system time with input [In1]. If [In1] is greater than or equal to [In2], the output [GeTrg] is set to 1 for one cycle. Changes at input [In2] does not trigger a pulse at output [GeTrg].