ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/DirectoryAccess/GetFileInDirectoryByIndex
The command returns the properties of the file with the specified index, located in the specified directory.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bDirectoryAccessGetFileInDirectoryByIndex : BOOL;
OutputDataDirectoryAccessGetFileInDirectoryByIndex : ST_GetFileInDirectoryByIndexOutputData;
hrDirectoryAccessGetFileInDirectoryByIndex : HRESULT;
fbDirectoryAccess : FB_DirectoryAccess;
END_VAR
hrDirectoryAccessGetFileInDirectoryByIndex := fbDirectoryAccess.GetFileInDirectoryByIndex(
bExecute := bDirectoryAccessGetFileInDirectoryByIndex,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sFullPath := 'D:\Test',
nIndex := 0,
OutputData => OutputDataDirectoryAccessGetFileInDirectoryByIndex);
IF hrDirectoryAccessGetFileInDirectoryByIndex <> S_FALSE THEN
bDirectoryAccessGetFileInDirectoryByIndex := 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".