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