LoadDocumentFromFile

LoadDocumentFromFile 1:

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 for one call whether the loading of the file was successful (TRUE) or failed (FALSE).

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

LoadDocumentFromFile 2: Return value

Name

Type

LoadDocumentFromFile

BOOL

LoadDocumentFromFile 3: Inputs

Name

Type

bExec

REFERENCE TO BOOL

LoadDocumentFromFile 4:/LoadDocumentFromFile 5: Inputs/Outputs

Name

Type

sFile

STRING

LoadDocumentFromFile 6: Outputs

Name

Type

hrErrorCode

HRESULT

Sample call:

IF bLoad THEN
  bLoaded := fbJson.LoadDocumentFromFile(sFile, bLoad);
END_IF