Table of Contents

DECOMPOSETIME

Function name

DECOMPOSETIME

ST call

PROGRAM DECOMPOSETIME_DEMO
 VAR
     DT1: DT;
        O1,MS:INT;
      H,M,S:SINT;
 END_VAR
 O1 := DECOMPOSETIME(T := DT1, HOURS => H, MINUTES => M, SECONDS => S, MILLISECONDS => MS);
END_PROGRAM

Description

Converts a DATETIME variable to individual time components as integer values.

Inputs

InputTypeDescription
T DT Input value

Outputs

Output TypeDescription
INT Output value, 1 means that the conversion has been executed successfully
HOURS INT number of hours
MINUTES SINTnumber of minutes
SECONDS SINTnumber of seconds
MILLISECONDSINT number of miliseconds

Application example