TextDocWriteToUrl Function Block

Help Contents


The TextDocWriteToUrl Function Block uploads a TextDocument object to URL.

The function block provides status information to:

Functions and Function Blocks

The TextDocWriteToUrl 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 this function block to sample the state of the URL Write as it executes.

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


The TextDocWriteToUrl 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.
DOCUMENTID STRING Input The identifier of the Text Document to write to a URL.
URL STRING Input The destination URL.
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.
COMMANDID UDINT Output The identifier of the command.
DONE BOOL Output Set to TRUE for 1 execution after the write operation has completed.
ERROR BOOL Output Set to TRUE if there was an error writing the Text Document to the URL.
ERRORMSG WSTRING Output If ERROR is TRUE, the reason why the write operation 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 TextDocWriteToUrl Function Block is only available to IEC 61131-3 code in an IEC 61131-3 Program Tag.


See TextDocFromHistoricData Example 2.

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.