A TextDocument Data Object represents the contents of a text document.
The text in the document can be queried using a Text Selector.
These document formats are supported:
How you create a TextDocument Data Object depends on where the IEC 61131-3 code is running:
Use this function to write a TextDocument to a URL:
These TextDocument Data Object functions are supported:
Function | Description |
---|---|
TextDocFromString | Creates a TextDocument Data Object from a string value. |
TextDocGetValue | Returns a value from a TextDocument Data Object using a Text Selector. |
VAR TextDocumentID, Index : DINT; Selector, Line : STRING; Message: STRING[1024]; END_VAR (* Create the TextDocument Data Object *) TextDocumentID := TextDocFromTagFile('Name Of Text Page Tag', 'Text'); Message := ''; FOR Index:=1 TO 3 DO Selector := CONCAT( 'Line(', TO_STRING(Index), ')'); Line := TO_STRING( TextDocGetValue( TextDocumentID, Selector ) ); Message := CONCAT( Message, Line, '$n' ); END_FOR (* Display the content *) MessageDialog( 'Information', Message );
To learn how to use data objects in IEC 61131-3 code.
To learn how IEC 61131-3 is used in Fernhill SCADA.
For the meaning of terms used in Fernhill SCADA.