GetDriveByIndex

TwinCAT TIA
Local Drive management

ns=2;s=DEPRAG Smart/Local/DriveManagement/GetDriveByIndex

The command returns the properties for the drive with the specified index.

Parameters:

    Index
    Unique index to retrieve the desired drive in the list.

Returns:

Examples:

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

Beckhoff parameter:

    bDriveManagementGetDriveByIndex
    A Boolean variable that can be used to trigger the execution of the GetDriveByIndex command.
    OutputDataDriveManagementGetDriveByIndex
    An instance of the "ST_GetDriveByIndexOutputData" in which the return value of the GetDriveByIndex method is written.
    hrDriveManagementGetDriveByIndex
    This can be used to monitor the execution of the command. Error codes have the type "HRESULT".
    fbDriveManagement
    An instance of the "FB_DriveManagement" function block supplied with the DEPRAG Smart library.
    nIndex
    A DINT variable containing the unique index to retrieve the desired drive in the list.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
          bDriveManagementGetDriveByIndex    : BOOL;
          OutputDataDriveManagementGetDriveByIndex : ST_GetDriveByIndexOutputData;
          hrDriveManagementGetDriveByIndex   : HRESULT;

          fbDriveManagement : FB_DriveManagement;
END_VAR

hrDriveManagementGetDriveByIndex := fbDriveManagement.GetDriveByIndex(
          bExecute    := bDriveManagementGetDriveByIndex,
          ConnectionHandle  := depragSmartConnection.ConnectionHandle,
          nIndex     := 0,
          OutputData   => OutputDataDriveManagementGetDriveByIndex);
IF hrDriveManagementGetDriveByIndex <> S_FALSE THEN 
          bDriveManagementGetDriveByIndex := 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".