ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/FileAccess/WriteAllText
The command writes a string to the specified file.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bFileAccessWriteAllText : BOOL;
OutputDataFileAccessWriteAllText : ST_VoidOutputData;
hrFileAccessWriteAllText : HRESULT;
fbFileAccess : FB_FileAccess;
END_VAR
hrFileAccessWriteAllText := fbFileAccess.WriteAllText(
bExecute := bFileAccessWriteAllText,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sfullPathSourceFile := 'C:\Test\text.txt',
sTextToWrite := 'Test123',
OutputData => OutputDataFileAccessWriteAllText);
IF hrFileAccessWriteAllText <> S_FALSE THEN
bFileAccessWriteAllText := 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".