ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/FileAccess/ReadAllText
The command reads the contents of a file into a string.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bFileAccessReadAllText : BOOL;
OutputDataFileAccessReadAllText : ST_ReadAllTextOutputData;
hrFileAccessReadAllText : HRESULT;
fbFileAccess : FB_FileAccess;
END_VAR
hrFileAccessReadAllText := fbFileAccess.ReadAllText(
bExecute := bFileAccessReadAllText,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sfullPathSourceFile := 'C:\Test\text.txt',
Encoding := Encoding.Utf8,
OutputData => OutputDataFileAccessReadAllText);
IF hrFileAccessReadAllText <> S_FALSE THEN
bFileAccessReadAllText := 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".