GetDrivesCount

TwinCAT TIA
Local Drive management

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

The command returns the number of available drives.

Returns:

    GetDrivesCount
    A variable of type OpcMethodReturnValueInt32. The Result property contains the command-specific return values.

Examples:

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

Beckhoff parameter:

    bDriveManagementGetDrivesCount
    A boolean variable that can be used to trigger the execution of the GetDrivesCount command.
    OutputDataDriveManagementGetDrivesCount
    An instance of "ST_Int32OutputData" into which the return value of the GetDrivesCount method is written.
    hrDriveManagementGetDrivesCount
    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.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
          bDriveManagementGetDrivesCount    : BOOL;
          OutputDataDriveManagementGetDrivesCount  : ST_Int32OutputData;
          hrDriveManagementGetDrivesCount    : HRESULT;

          fbDriveManagement : FB_DriveManagement;
END_VAR

hrDriveManagementGetDrivesCount := fbDriveManagement.GetDrivesCount(
          bExecute    := bDriveManagementGetDrivesCount,
          ConnectionHandle  := depragSmartConnection.ConnectionHandle,
          OutputData   => OutputDataDriveManagementGetDrivesCount);
IF hrDriveManagementGetDrivesCount <> S_FALSE THEN 
          bDriveManagementGetDrivesCount := 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".