BinaryTime_To_SystemTime

Konvertiert die Zeitinformation des Typs T_BinaryTime (Binary-Time-Format) in die Zeitinformation des Typs TIMESTRUCT (System-Time-Format). Beim Konvertierungsfehler hat die Ausgangsvariable „bOverflow“ den Wert „TRUE“ und der zurückgelieferte System-Time-Wert das Datum:1970-01-01 und die Uhrzeit: 0h0m0s0ms.

Namensraum: Tc3_Collections
Bibliothek: Tc3_Collections (Tc3_Collections.compiled-library)

Syntax

FUNCTION BinaryTime_To_SystemTime : TIMESTRUCT
VAR_INPUT
    in        : T_BinaryTime;
END_VAR
VAR_OUTPUT
    bOverflow : BOOL;
END_VAR

BinaryTime_To_SystemTime 1: Eingänge

Name

Typ

Beschreibung

in

T_BinaryTime

Die zu konvertierende Zeitinformation als Binary-Time-Struktur.

BinaryTime_To_SystemTime 2: Ausgänge

Name

Typ

Beschreibung

bOverflow

BOOL

Datumsüberlauf wenn “TRUE“. In diesem Fall hat die zu konvertierende Binary-Time ein Datum (T_BinaryTime.day member) welches größer ist als 2106-02-07.

BinaryTime_To_SystemTime 3: Rückgabewert

Name

Typ

Beschreibung

BinaryTime_To_SystemTime

TIMESTRUCT

Konvertierte Zeitinformation als System-Time-Struktur.

Beispiel

PROGRAM MAIN
VAR
    tSystem   : TIMESTRUCT;
    tBinary   : T_BinaryTime;
    bOverflow : BOOL;
END_VAR
tSystem.wYear:=2022;
tSystem.wMonth:=9;
tSystem.wDay:=16;
tSystem.wHour:=12;
tSystem.wMinute:=52;
tSystem.wSecond:=4;
tSystem.wMilliseconds:=500;
tBinary:=SystemTime_To_BinaryTime(in:=tSystem, bOverflow=>bOverflow);(* Returns tBinary.timeOfDay = TOD#12:52:04.500 and tBinary.day = 14138 *)

tBinary.day:=1;
tBinary.timeOfDay:=TOD#01:30:15.500;
tSystem:=BinaryTime_To_SystemTime(in:=tBinary, bOverflow=>bOverflow);(* Returns system-time date: 1984-01-02 and time: 01h30m15s500ms*)