SUB_TIME - Subtract two interval values

Introduction

Returns the difference of two interval values.

Informal Syntax:

SUB_TIME( In1, In2 )

Formal Syntax:

SUB_TIME( In1:=expression, In2:=expression )

Parameters

ParameterTypeDescription
In1TIMEThe first interval value.
In2TIMEThe second interval value.

In1 and In2 can be any interval values, positive or negative.

Return value

The function SUB_TIME returns the result of In1 - In2.

The overloaded function SUB can also be used to subtract two interval values.

Examples

ExampleReturn Value
SUB_TIME( T#5s, T#10s )TIME#-5s
SUB_TIME( T#4h, T#-10h )TIME#14h

Standards Compliance

Table 30.4b - IEC 61131-3 2nd Edition.

Table 35.4b - IEC 61131-3 3rd Edition.

Further Information

Date and Time Functions

For other date and time functions.

Glossary

For definitions of the terms used in Fernhill SCADA.