LoadDocumentFromFile

This method loads a JSON document from a file.
A rising edge on the input parameter bExec triggers the loading procedure. The asynchronous process is terminated as soon as the reference bExec is set back to FALSE from the method. When the process ends, the return value of the method indicates whether the loading of the file was successful (TRUE) or failed (FALSE) for the duration of one call.
![]() | Encoding Please note that the imported files must be formatted in UTF-8. Formats such as UTF-16 are not supported. |
Syntax
METHOD LoadDocumentFromFile : BOOL
VAR_IN_OUT CONSTANT
sFile : STRING;
END_VAR
VAR_INPUT
bExec : REFERENCE TO BOOL;
END_VAR
VAR_OUTPUT
hrErrorCode: HRESULT;
END_VAR
Return value
Name | Type |
---|---|
LoadDocumentFromFile | BOOL |
Inputs
Name | Type |
---|---|
bExec | REFERENCE TO BOOL |
/
Inputs/outputs
Name | Type |
---|---|
sFile | STRING |
Outputs
Name | Type |
---|---|
hrErrorCode | HRESULT |
Sample call:
IF bLoad THEN
bLoaded := fbJson.LoadDocumentFromFile(sFile, bLoad);
END_IF