ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/Json/OpenJsonDocument
The command opens a JSON file for further processing. The reader can be retrieved from the ActiveJsonDocuments list using the returned index.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bJsonOpenJsonDocument : BOOL;
OutputDataJsonOpenJsonDocument : ST_JsonDocumentOutputData;
hrJsonOpenJsonDocument : HRESULT;
fbJson : FB_Json;
END_VAR
hrJsonOpenJsonDocument := fbJson.OpenJsonDocument(
bExecute := bJsonOpenJsonDocument,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sfullFilePath := 'C:\Test\Test.json',
OutputData => OutputDataJsonOpenJsonDocument);
IF hrJsonOpenJsonDocument <> S_FALSE THEN
bJsonOpenJsonDocument := 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".