Visualization Element 'Text editor'

 

Symbol:

_visu_img_text_editor.png

Tag: Special controls

The element shows the contents of text files that are saved on the PLC. Files can be encoded in ASCII or Unicode formats.

A visualization user can also edit the text.

Element properties

Element name

Example: GenElemInst_1

Type of element

Text editor

Element property 'Position'

The position defines the location and size of the element in the visualiza­tion window. These are based on the Cartesian coordinate system. The origin is located at the upper left corner of the window. The positive hori­zontal x-axis runs to the right. The positive vertical y-axis runs down­wards.

X

X coordinate of the upper left corner of the element

Specified in pixels.

Example: 10.

Y

Y coordinate of the upper left corner of the element

Specified in pixels.

Example: 10.

Width

Specified in pixels.

Example: 150

Height

Specified in pixels.

Example: 30

Note

You can also change the values by dragging the box symbols (_visu_icon_position_element.png) to other positions in the editor.

See also

Element property 'Font'

Name

Unproportional font for displaying the file contents in the visualization.

Example: Courier New

Size

Font size

Example: 12

Element property 'Control variables'

Element property Control variables --> File

Variable

Variable (STRING). Contains the file names and optionally the location of the file. They is located in the file system of the controller.

Example: PLC_PRG.strFile: STRING := '/Documentation/Info.txt';

Open

Variable (BOOL). Controls the opening of the file that is defined in the Variable property.

Example: bOpen: BOOL;

TRUE: The file is opened.

Close

Variable (BOOL). Controls the closing of the file that is defined in the Variable property.

Example: bClose: BOOL;

TRUE: The file is closed.

Save

Variable (BOOL). Controls the saving of the file that is defined in the Variable property.

Example: bStore: BOOL;

TRUE: The file is saved.

New

Variable (BOOL). Controls the creation of a new file. The name is defined in the Variable property.

Example: bCreate: BOOL;

TRUE: Creates and opens a file.

Element property Control variables --> Edit

Variable

Variable (STRING). Contains the string to search for in the file.

Example: strFind: STRING := 'abc';

Find

Variable (BOOL). Controls executing the search for the string in the Variable property.

Example: bFind: BOOL;

TRUE: The search is performed. The variable is automatically reset to FALSE.

Find next

Variable (BOOL). Controls the location to begin the search in the file.

Example: bFindNext: BOOL;

TRUE: The search begins at the last search result location.

FALSE: The search starts at the beginning of the file.

Element property Control variables --> Caret position

Line

Variable (integer data type). Contains the line of the caret.

Example: iRowCursor: INT;

Column

Variable (integer data type). Contains the column of the caret.

Example: iColumnCursor: INT;

Position

Output variable (integer data type). Returns the absolute caret position in the text.

Example: iPosCursor: INT;

Set cursor

Variable (BOOL). Controls the setting of the caret at a specific location.

Example: iSetCursor: INT;

TRUE: The caret is moved. The new position is defined in the Line and Column properties.

FALSE: The Line, Column, and Position properties contain the actual values.

Note: This variable is used as the control variable for an input event triggered by a visualization user.

Element property Control variables --> Selection

Start position

Output variable (integer data type). Shows the absolute position for starting the text selection.

Example: iPosSelection: INT;

End position

Output variable (integer data type). Shows the absolute position for ending the text selection.

Example: iPosEndSelection: INT;

Start line number

Output variable (integer data type). Shows the line where the text selection begins.

Example: iRowSelection: INT;

Start column index

Output variable (integer data type). Shows the column where the text selection begins.

Example: iColumnSelection: INT;

End line number

Output variable (integer data type). Shows the line where the text selection ends.

Example: iRowEndSelection: INT;

End column index

Output variable (integer data type). Shows the column where the text selection ends.

Example: iColumnEndSelection: INT;

Line to select

Variable (integer data type). Contains the line number that is selected.

Note: The selection is controlled by the variables in the Trigger select property.

Set select

Variable (BOOL). Controls the selection of a line.

Example: bSetSelection: BOOL;

TRUE: The line from the Line to select property is selected and highlighted in the text editor.

if the line is not in the current text segment of the text editor, then the text segment is moved to this line.

Note: This variable is used as the control variable for an input event triggered by a visualization user. The control variable is not reset automatically. You are responsible for this happening in the visualization.

Element property Control variables --> Error handling

Variable for error code

Variable (integer data type). Contains the error code when an error occurs.

Example: iError: INT;

The error codes are declared in GVL_ErrorCodes in the VisuElemTextEditor library. For displaying the English error text, the VisuFctTextEditorGetErrorText() function of the library must be called.

Variable for contents changed

Variable (BOOL). Shows whether the contents have changed.

Example: bIsContentEdited: BOOL;

TRUE: The contents of the text editor have changed.

Variable for access mode

Variable (BOOL). Controls the access privileges to the file.

Example: bIsReadOnly: BOOL;

TRUE: A visualization user has read-only permission. In runtime mode, the file contents are highlighted in gray in the text editor.

FALSE: A visualization user has read/write permission.

Note: The variable overwrites the setting in the Editor mode property.

Maximum line length

Maximum number of characters per row

Editor mode

  • Read-only: A visualization user has read-only permissions to the file. In runtime mode, the file contents are highlighted in gray in the text editor.

  • Read/write: A visualization user has read-write permissions.

Element property 'New files'

Encoding

Character encoding of the new file:

  • ASCII

  • Unicode (Little endian)

  • Unicode (Big endian)

New line character sequence

End of line character of the new file:

  • CR/LF: Normal for Windows systems

  • LF: Normal for UNIX systems

Please note: When a visualization user opens an existing file, the end-of-line character of the file is detected and used automatically.

These properties are available only when you select the Preview: Support client animations and overlay of native elements option in the Visualization Manager.

You can animate a movement, a rotation, and the visibility of a visualiza­tion element.

Animation time

Time that the element executes an animation (in milliseconds)

Example: 500

Move to the foreground

Property value (BOOL)

TRUE: At runtime, the element is displayed in the foreground.

FALSE: At runtime, the element is displayed in the layer where it was inserted in the visualization editor.

See also

See also