GetDateTimeSetting

TwinCAT TIA
Devices DEPRAG devices Sequence controller ActiveDevices One client Settings Date/Time

ns=2;s=DEPRAG Smart/Devices/DEPRAG/AST/ActiveDevices/0/Settings/DateTime/GetDateTimeSetting

Gets the current system time of the sequence controller.

Returns:

Examples:

In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:

Beckhoff parameter:

    bAstGetDateTimeSetting
    A boolean variable that can be used to trigger the execution of the GetDateTimeSetting command.
    outputAstGetDateTimeSetting
    An instance of the ST_AstGetDateTimeSettingOutputData structure into which the return value of the GetDateTimeSetting method is written.
    hrAstGetDateTimeSetting
    This can be used to monitor the execution of the command. Error codes have the type HRESULT.
    fbAst
    An instance of the FB_AST function block supplied with the DEPRAG Smart library.
    sDeviceId
    A string value specifying the device for which the system time setting is to be retrieved.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
       bAstGetDateTimeSetting    : BOOL;
       outputAstGetDateTimeSetting   : ST_AstGetDateTimeSettingOutputData;                                          
       hrAstGetDateTimeSetting    : HRESULT;

     fbAst   : FB_AST;
END_VAR

hrAstGetDateTimeSetting := fbAst.GetDateTimeSetting(
       bExecute    := bAstGetDateTimeSetting,   
       ConnectionHandle := depragSmartConnection.ConnectionHandle,
       sDeviceId   := '0',
       OutputData   => outputAstGetDateTimeSetting);
IF hrAstGetDateTimeSetting <> S_FALSE THEN 
 bAstGetDateTimeSetting := FALSE;
END_IF
                                                    

For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".