SUB_TIME

Returns the difference of two time durations.

Signature

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

Both inputs and the return value are TIME.

Inputs

Name

Type

Description

IN1

TIME

The minuend duration.

IN2

TIME

The subtrahend duration.

Outputs

Name

Type

Description

Return value

TIME

IN1 minus IN2 as a duration.

Description

Returns the difference IN1 minus IN2 as a time duration.

Example

result := SUB_TIME(T#5s, T#2s);   (* result = T#3s *)

See Also

References