ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/DirectoryAccess/GetFilesInDirectory
The command outputs an array with all files in the specified path. Each array element contains the properties of a file.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bDirectoryAccessGetFilesInDirectory : BOOL;
OutputDataDirectoryAccessGetFilesInDirectory : ST_GetFilesInDirectoryOutputData;
hrDirectoryAccessGetFilesInDirectory : HRESULT;
fbDirectoryAccess : FB_DirectoryAccess;
END_VAR
hrDirectoryAccessGetFilesInDirectory := fbDirectoryAccess.GetFilesInDirectory(
bExecute := bDirectoryAccessGetFilesInDirectory,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sFullPath := 'C:\Test',
OutputData => OutputDataDirectoryAccessGetFilesInDirectory);
IF hrDirectoryAccessGetFilesInDirectory <> S_FALSE THEN
bDirectoryAccessGetFilesInDirectory := 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".