SystemTime_To_BinaryTime

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

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

Syntax

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

SystemTime_To_BinaryTime 1: Eingänge

Name

Typ

Beschreibung

in

TIMESTRUCT

Die zu konvertierende Zeitinformation als System-Time-Struktur.

SystemTime_To_BinaryTime 2: Ausgänge

Name

Typ

Beschreibung

bOverflow

BOOL

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

SystemTime_To_BinaryTime 3: Rückgabewert

Name

Typ

Beschreibung

SystemTime_To_BinaryTime

T_BinaryTime

Konvertierte Zeitinformation als Binary-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*)