SUB_TOD_TIME

Subtracts a duration from a time-of-day value.

Signature

     ┌────────────┐
IN1 ─┤            │
     │SUB_TOD_TIME├─ OUT
IN2 ─┤            │
     └────────────┘
FUNCTION SUB_TOD_TIME : TIME_OF_DAY
  VAR_INPUT
    IN1 : TIME_OF_DAY;
    IN2 : TIME;
  END_VAR
END_FUNCTION

The return type is TIME_OF_DAY. IN1 is TIME_OF_DAY and IN2 is TIME.

Inputs

Name

Type

Description

IN1

TIME_OF_DAY

The time-of-day to offset.

IN2

TIME

The duration to subtract.

Outputs

Name

Type

Description

Return value

TIME_OF_DAY

IN1 with IN2 subtracted.

Description

Returns a new TIME_OF_DAY offset from IN1 by subtracting the duration IN2. Both values are in milliseconds.

Example

result := SUB_TOD_TIME(TOD#14:00:00, T#1h);  (* result = TOD#13:00:00 *)

See Also

References