FB_GetTimeZoneInformation

FB_GetTimeZoneInformation 1:

This function block can be used to read the time zone settings of the operating system.

FB_GetTimeZoneInformation 2: Inputs

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

Name

Type

Description

sNetID

T_AmsNetID

AmsNetId (AMS network identifier) of the TwinCAT computer whose time zone settings are to be read. For the local computer an empty string may be specified.

bExecute

BOOL

The function block is enabled by a positive edge at this input.

tTimeout

TIME 

States the length of the timeout that may not be exceeded by execution of the ADS command.

FB_GetTimeZoneInformation 3: Outputs

VAR_OUTPUT
    bBusy  : BOOL;
    bError : BOOL;
    nErrID : UDINT;
    tzID   : E_TimeZoneID;
    tzInfo : ST_TimeZoneInformation;
END_VAR

Name

Type

Description

bBusy

BOOL

When the function block is enabled, this output is set and remains set until a feedback is received.

bError

BOOL

If an error occurs during the transmission of the command, this output is set after the bBusy output is reset.

nErrID

UDINT

Returns the ADS error number when the bError output is set.

tzID

E_TimeZoneID

Additional summer/winter time information (not always present)

tzInfo

ST_TimeZoneInformation

If successful this structure variable returns the current time zone information of the operating system.

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)