ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/FileAccess/DeleteFile
The command deletes the file 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
bFileAccessDeleteFile : BOOL;
OutputDataFileAccessDeleteFile : ST_VoidOutputData;
hrFileAccessDeleteFile : HRESULT;
fbFileAccess : FB_FileAccess;
END_VAR
hrFileAccessDeleteFile := fbFileAccess.DeleteFile(
bExecute := bFileAccessDeleteFile,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sfullPathSourceFile := 'C:\Test2\text.txt',
OutputData => OutputDataFileAccessDeleteFile);
IF hrFileAccessDeleteFile <> S_FALSE THEN
bFileAccessDeleteFile := 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".