ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/DirectoryAccess/GetFilesInDirectoryCount
The command returns the number of files contained in the specified path.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bDirectoryAccessGetFilesInDirectoryCount : BOOL;
OutputDataDirectoryAccessGetFilesInDirectoryCount : ST_Int32OutputData;
hrDirectoryAccessGetFilesInDirectoryCount : HRESULT;
fbDirectoryAccess : FB_DirectoryAccess;
END_VAR
hrDirectoryAccessGetFilesInDirectoryCount := fbDirectoryAccess.GetFilesInDirectoryCount(
bExecute := bDirectoryAccessGetFilesInDirectoryCount,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sFullPath := 'C:\Test',
OutputData => OutputDataDirectoryAccessGetFilesInDirectoryCount);
IF hrDirectoryAccessGetFilesInDirectoryCount <> S_FALSE THEN
bDirectoryAccessGetFilesInDirectoryCount := 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".