SYSTEMTIME_TO_DCTIME
This function converts the structured "Windows System Time" variable to the 64 bit "Distributed Clock System Time" variable. If conversion fails the return value is zero.
FUNCTION SYSTEMTIME_TO_DCTIME: T_DCTIME
VAR_INPUT
in : TIMESTRUCT;
micro : WORD(0..999); (* Microseconds: 0..999 *)
nano : WORD(0..999); (* Nanoseconds: 0..999 *)
END_VAR
in: The "Windows System Time" variable to be converted.
micro: Microseconds.
nano: Nanoseconds.
Example:
PROGRAM P_TEST
VAR
syst : TIMESTRUCT := ( wYear := 2009, wMonth := 9, wDay := 16, wHour := 12, wMinute := 22, wSecond := 44, wMilliseconds := 123 );
END_VAR
dct := SYSTEMTIME_TO_DCTIME( syst, 456, 789 );
Requirements
Development environment | Target system type | PLC libraries to be linked |
---|---|---|
TwinCAT v2.10.0 Build > 1340 | PC or CX (x86, ARM) | TcEtherCAT.Lib |