Documentation

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

Input Type Description
T DT Input value

Outputs

Output Type Description
=> INT Output value, 1 means that the conversion has been executed successfully
HOURS INT number of hours
MINUTES SINT number of minutes
SECONDS SINT number of seconds
MILLISECONDS INT number of miliseconds

Application example