DCTIMESTRUCT_TO_DCTIME
Outdated function This function is outdated. Use the function DCTIMESTRUCT_TO_DCTIME64 instead. |
The function converts a structured variable of type DCTIMESTRUCT to a 64-bit distributed clock system time variable of type T_DCTIME.
The structure components wDayofWeek is ignored in the conversion. The structure components wYear must be greater than or equal to 2000 and less than 2584. For invalid values of the structure components the function returns the value zero.
FUNCTION DCTIMESTRUCT_TO_DCTIME: T_DCTIME
Inputs
VAR_INPUT
in : DCTIMESTRUCT;
END_VAR
Name | Type | Description |
---|---|---|
in | DCTIMESTRUCT | The structured variable to be converted |
Sample:
PROGRAM P_TEST
VAR
dcStruct : DCTIMESTRUCT := ( wYear := 2008, wMonth := 3, wDay := 13,
wHour := 1, wMinute := 2, wSecond :=3,
wMilliseconds := 123, wMicroseconds := 456, wNanoseconds := 789 );
dc64 : T_DCTIME;
END_VAR
dc64 := DCTIMESTRUCT_TO_DCTIME( dcStruct );
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.0 | PC or CX (x86, x64, ARM) | Tc2_EtherCAT |