TextDocFromURL Function Block

Help Contents


The TextDocFromURL Function Block creates a TextDocument object from a file downloaded from a URL.

The function block provides status information to:

Functions and Function Blocks

The TextDocFromURL Function Block is intended for use in a Program Tag that runs on the Fernhill SCADA Server. A Program Tag uses a continuous execution model, where the program code runs at a fixed interval. A program uses the function block to sample the state of the tag command as it executes.

There is no equivalent TextDocFromURL Function for use in an Operator Action.


The TextDocFromURL Function Block has this syntax:

        ERRORMSG=>Variable-Reference );

Note: All parameters are optional.


Parameter Type Direction Description
REQ BOOL R_EDGE Input A rising edge triggers the start of the file download.
URL STRING Input The URL to download the file from.
TIMEOUT TIME Input The maximum time allowed to download the file from the URL. If not declared, the timeout defaults to 30 seconds (T#30s).
OPTIONS STRING Input The options to apply to the file download. See URL Options for a description of the format of this parameter.
BUSY BOOL Output Set to TRUE while the configuration change is in progress.
DOCUMENTID UDINT Output The identifier of the TextDocument Object. Note: This value is only valid while the DONE output parameter is TRUE.
DONE BOOL Output Set to TRUE for 1 execution after the configuration change has completed.
ERROR BOOL Output Set to TRUE if there was an error executing the configuration change.
ERRORMSG WSTRING Output If ERROR is TRUE, the reason why the configuration change failed.


Once the function block starts, additional requests from the input signal REQ are ignored until the configuration change completes.

These timing diagrams show the relationship of the REQ, BUSY, DONE, and ERROR signals processing two requests. The first request completes with an error, the second request completes normally:

        +--------+     +-+ +------+
  REQ   |        |     | | |      |
      --+        +-----+ +-+      +------

        +------+       +------+
 BUSY   |      |       |      |
      --+      +-------+      +----------

               ++             ++
 DONE          ||             ||

ERROR          |       |
      ---------+       +-----------------

The BUSY signal is TRUE while the configuration change is in progress. The DONE signal is TRUE for 1 execution after the completion of the configuration change.

The TextDocFromURL Function Block is only available to IEC 61131-3 code in an IEC 61131-3 Program Tag.


Further Information

TextDocument Functions

For information about functions to manage TextDocument data objects.

Data Objects

For information about all Data Objects supported by Fernhill SCADA

IEC 61131-3

To learn how IEC 61131-3 is used in Fernhill SCADA.


For the meaning of terms used in Fernhill SCADA.