This method is used for asynchronous parsing of a JSON-formatted file located on the file system of the controller. The parsing can take several program cycles. While the parsing is in progress, no other method or property of the function block instance is processed. The number of bytes processed in one cycle is determined by the global parameter GPL.Gc_udiJsonMaxNumOfBytesPerCycle. After successful execution of the method, the root item is selected.
If an error was detected use the properties Result and ResultMsg to obtain the result of the method.
The parsing is completed if one of the outputs q_xDone or q_xError indicates TRUE. You must cyclically call the method while the output q_xBusy is TRUE.
Input |
Data type |
Description |
---|---|---|
i_sFilePath |
STRING [255] |
The path to the JSON file that shall be read. If a file name is specified without file extension, the function block adds the extension .json. |
i_anyBuffer |
ANY |
Address of the variable containing the JSON-formatted data allocated in the application. Variables of type STRING or ARRAY OF BYTE are supported. |
i_sJPath |
STRING [GPL.Gc_uiJsonMaxLengthOfJPath] |
Allows partly parsing JSON-formatted data: Only the items in the sub-hierarchy level as the element selected by the JPath expression are parsed. To parse the complete data, assign a null string. Also refer to the list of supported JPath expressions. |
Output |
Data type |
Description |
---|---|---|
q_xBusy |
BOOL |
If this output is set to TRUE, the method execution is in progress. |
q_xDone |
BOOL |
If this output is set to TRUE, the method execution has been completed successfully. |
q_xError |
BOOL |
If this output is set to TRUE, an error has been detected. For details, refer to q_etResult and q_etResultMsg. |