SystemDataItemByKey

TwinCAT TIA
Devices DEPRAG devices Sequence controller ActiveDevices One client System info Controller data

ns=2;s=DEPRAG Smart/Devices/DEPRAG/AST/ActiveDevices/0/SystemOverview/SystemData/SystemDataItemByKey

Gets one entry.

Parameters:

    Key
    Unique identifier that determines which entry is to be retrieved from the system data.

Returns:

    SystemDataItemByKey
    A variable of type OpcMethodReturnValueString. The Result property contains the command-specific return values
      Result
      Value of the requested parameter.

Examples:

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

Beckhoff parameter:

    bAstSystemDataItemByKey
    A boolean variable that can be used to trigger the execution of the SystemDataItemByKey command.
    outputAstSystemDataItemByKey
    An instance of the ST_StringOutputData structure into which the return value of the SystemDataItemByKey method is written.
    hrAstSystemDataItemByKey
    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 system data is to be fetched.
    sKey
    The string variable specifies which parameter of the system data is to be read out.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
     bAstSystemDataItemByKey    : BOOL;
     outputAstSystemDataItemByKey  : ST_StringOutputData;                                          
     hrAstSystemDataItemByKey   : HRESULT;

     fbAst   : FB_AST;
END_VAR

hrAstSystemDataItemByKey := fbAst.SystemDataItemByKey(
       bExecute    := bAstSystemDataItemByKey,   
       ConnectionHandle := depragSmartConnection.ConnectionHandle,
       sDeviceId   := '0',
       sKey    := 'DeviceName',
       OutputData   => outputAstSystemDataItemByKey);
IF hrAstSystemDataItemByKey <> S_FALSE THEN 
 bAstSystemDataItemByKey := 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".