FB_GetTimeZoneInformation
![FB_GetTimeZoneInformation 1:](Images/png/9007199290264075__Web.png)
This function block can be used to read the time zone settings of the operating system.
VAR_INPUT
VAR_INPUT
sNetID : T_AmsNetID;
bExecute : BOOL;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
sNetID: Here you can enter a string with the network address of the TwinCAT computer whose time zone settings are to be read (type: T_AmsNetID). If it is to be run on the local computer, an empty string can be entered.
bExecute: the block is activated by a positive edge at this input.
tTimeout: States the length of the timeout that may not be exceeded by execution of the ADS command.
VAR_OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrId : UDINT;
tzID : E_TimeZoneID;
tzInfo : ST_TimeZoneInformation;
END_VAR
bBusy: When the function block is activated this output is set. It remains set until a feedback is received.
bError: In the event of an error during the command transfer, this output is set once the bBusy output has been reset.
nErrId: Supplies the ADS error number when the bError output is set.
tzID: Additional summer/ winter time information (not always present) (type: E_TimeZoneID).
tzInfo: If successful this structure variable supplies the current time zone information of the operating system (type: ST_TimeZoneInformation).
Example:
See description of the FB_SetTimeZoneInformation function block.
Further functions and function blocks for time and time zone:
Requirements
Development environment | Target platform | PLC libraries to be integrated (category group) |
---|---|---|
TwinCAT v3.1.0 | PC or CX (WES7/Win7/Win10: TC RT x86/x64, WEC6/7: TC RT x86, WEC7: TC CE7 ARMV7) | Tc2_Utilities (System) |