GetDirectorySizeInByte

TwinCAT TIA
Local File and directory access Folder

ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/DirectoryAccess/GetDirectorySizeInByte

The command gets the size of the specified directory in bytes.

Parameters:

Returns:

    GetDirectorySizeInByte
    A variable of type OpcMethodReturnValueInt64. The Result property contains the command-specific return values.
      Result
      Size of the directory in bytes.

Examples:

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

Beckhoff parameter:

    bDirectoryAccessGetDirectorySizeInByte
    A boolean variable that can be used to trigger the execution of the GetDirectorySizeInByte command.
    OutputDataDirectoryAccessGetDirectorySizeInByte
    An instance of the "ST_GetDirectorySizeInByteOutputData" to which the return value of the GetDirectorySizeInByte method is written.
    hrDirectoryAccessGetDirectorySizeInByte
    This can be used to monitor the execution of the command. Error codes have the type "HRESULT".
    fbDirectoryAccess
    An instance of the "FB_DirectoryAccess" function block supplied with the DEPRAG Smart library.
    sFullPath
    A STRING variable containing the full path of the directory.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
     bDirectoryAccessGetDirectorySizeInByte    : BOOL;
     OutputDataDirectoryAccessGetDirectorySizeInByte  : ST_GetDirectorySizeInByteOutputData;
     hrDirectoryAccessGetDirectorySizeInByte    : HRESULT;

     fbDirectoryAccess : FB_DirectoryAccess;
END_VAR

hrDirectoryAccessGetDirectorySizeInByte := fbDirectoryAccess.GetDirectorySizeInByte(
              bExecute    := bDirectoryAccessGetDirectorySizeInByte,   
              ConnectionHandle := depragSmartConnection.ConnectionHandle, 
              sFullPath   := 'C:\Test',
              OutputData   => OutputDataDirectoryAccessGetDirectorySizeInByte);
IF hrDirectoryAccessGetDirectorySizeInByte <> S_FALSE THEN 
     bDirectoryAccessGetDirectorySizeInByte := 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".