FB_GetTimeZoneInformation

FB_GetTimeZoneInformation 1:

With this function block the time zone settings of the operating system can be read.

VAR_INPUT

VAR_INPUT
    sNetID      : T_AmsNetID;
    bExecute    : BOOL;
    tTimeout    : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR

sNetID: Here a string containing the network address of the TwinCAT Computer can be given, whose time zone setting is to be read. The string can also be empty for the local computer.    

bExecute: The command is executed with a positive edge at the input

tTimeOut: Maximum time allowed for the 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 and acknowledgement is received.

bError:  If an ADS error should occur during the execution of the command, then this output is set, after the bBusy output has been reset. 

nErrId: When the bError output is set, this variable supplies the ADS error or the command-specific error code (table).

tzID: Additional daylight-saving/standard time information (not always existent).

tzInfo: In case of success this structure variable supplies the current time zone information of the operating system.

 

Example:  See description of the function block  FB_SetTimeZoneInformation.

 

Further time, time zone functions and function blocks:

FB_TzSpecificLocalTimeToSystemTime, FB_TzSpecificLocalTimeToFileTime, FB_SystemTimeToTzSpecificLocalTime, FB_FileTimeTimeToTzSpecificLocalTime, FB_GetTimeZoneInformation, FB_SetTimeZoneInformation, NT_SetLocalTime, NT_GetTime, NT_SetTimeToRTCTime, F_TranslateFileTimeBias, FB_LocalSystemTime

Requirements

Development Environment

Target System

PLC libraries to include

TwinCAT v2.10.0 Build > 1319

PC or CX (x86)
CX (ARM)

TcUtilities.Lib