GETSYSTEMTIME
This function block is replaced by the newer function F_GetSystemTime(), which only needs one return value, not two. |
With this function block the operating system time stamp can be read. The time stamp is a 64 bit integer value, with a precision of 100ns, which is updated with every call of the PLC. Amongst other uses, it can be utilized for timing tasks or time measurements. One unit corresponds to 100 ns. The time represents the number of 100 ns intervals since 1 January 1601.
See: F_GetSystemTime
Inputs
VAR_INPUT
(*none*)
END_VAR
Outputs
VAR_OUTPUT
timeLoDW : UDINT;
timeHiDW : UDINT;
END_VAR
Name | Type | Beschreibung |
---|---|---|
timeLoDW | UDINT | Contains the low-value 4 bytes of the time stamp. |
timeHiDW | UDINT | Contains the high-value 4 bytes of the time stamp. |
Sample of calling the function block in FBD:
The sample illustrates calling the function block via the instance ‘GetSystemTime1’, and delivers the 64 bit, integer value (hex) 1BCD6EAB05C4E60 as the time stamp.
Requirements
Development environment |
Target system type |
PLC libraries to include (Category group) |
---|---|---|
TwinCAT v3.1.0 |
PC or CX (x86, x64, ARM) |
Tc2_System (System) |