Table

As soon as a table is inserted for the purpose of visualization of an array, the dialog Configure Table will be opened. Besides the categories ‘Tooltip’ and ‘Security’ which are also available for other visualization elements, the following categories will be available for configuring display and contents of the table.

Category Table:

../_images/ea29dcda4377ebe60a33139006eab46b

Do the following table settings:

  • Data array:  Insert the name of an array which should be visualized in the table. It is recommended to use the input assistant (<F2>) resp. the Intellisense function.
  • Slider size: Insert here the desired height of the slider which will appear at the bottom of the table element if the display of the array columns exceeds the element width.
  • Column header, Line header: Activate these options if you want to get displayed the titles in the table. The line title reflects the array index (first column of the table), the column title can be defined in category ‘Columns’.

Category Columns:

../_images/26e35b834377eb4a0a33139006eab46b

Here you define the table elements. In the left window you get al list of all elements, which are handled in the array per index. In case of an array of a structure these would be the structure components.

Using the arrow button > you can transfer a selected component from the left window to the right window where you define the set of elements to be displayed in the table. Pressing button >> all elements will be transferred at a single blow. In the same manner you can remove elements from an already defined set (<, <<). In order to modify the default settings concerning the display of the table column for one of the elements, perform a double-click on the desired entry in the right part of the window, or press button ‘…’ to open the dialog ‘Configure columns’:

../_images/334ab5b94377eba70a33139006eab46b

Editing the column header and the column width:

Initially the edit field Column header will contain an automatically created title (e.g. “PLC_PRG.arr1[INDEX].iNo” in case of an array of structure for the column representing the structure component “iNo”) which you can change. Further on the Column width (number of characters) can be set.

Editing \ configuration parameters for all elements of a column:

By default the table fields are displayed as simple rectangles and the entries are not editable. If you however activate button Edit template for the currently marked column, you can modify the parameters of the fields of this column, e.g. the line width, text input etc. The template affects all fields of the current column and can be edited via the known configuration dialog for a visualization element.

If you want to configure only one or several particular fields of the column, you can use the following placeholders determining the desired row and column: $ROWCONST$, $COLCONST$, INDEX. (INDEX has the same effect as $ROWCONST$).

Examples for the \ use of placeholders in column-templates:

Example 1:

You visualize an array “arr1 [0..2] of BOOL” (table with 1 column) and you want, that in online mode by a mouse-click on a table cell the cell gets red-colored and the corresponding array element will be toggled and vice versa. To reach this activate ‘Use template’ in the configuration dialog for the column and define the template as follows: Category ‘Input’, Action ‘Toggle variable’: “PLC_PRG.arr1[INDEX]. Category ‘Colors’: Alarm color red. Category ‘Variables’, Action ‘Change color’: “PLC_PRG.arr1[INDEX].

Example 2:

The following template configuration has been created for a table column representing Index “0” of an array:

../_images/b587f28028fd34a80a317f3448c5196c

Meaning: For the concerned table column…

  • the field in line 6 (line number, index) is invisible.
  • in the field in line 7 no edit field can be opened.
  • in all fields of column 0 the color will change to alarm color. The other fields of the column remain in base color.
  • always entered automatically, but of course changeable, is the textdisplay configuration, which combined with the “%s” entry in category “Text” effects that the corresponding variable value will be displayed in the table field.

The placeholder entries can be connected with “AND” resp. “OR”; Example: “$ROWCONST$=1 OR $ROWCONST$=3” makes that both fields will get the respective setting.

The use of the currently configured template can be activated or deactivated: Option Use template.

Category Rows:

../_images/e03841504377ec340a33139006eab46b

Row height:  Insert the desired height in number of pixels.

Category Selection:

../_images/c8cfaeac4377eafc0a33139006eab46b

Here you can set the following parameters concerning the selection behaviour within the table:

  • Selection color:  Press this button to define  a color for selected cells. You get the standard dialog for choosing a color or a color selection list.
  • Selection type:  Define which part of the table will be selected when you perform a mouse-click on one of the table fields in online mode:
    • Select single cells:  Only the cell will be selected.
    • Select only rows:  The whole line will be selected.
    • Select only columns:  The whole column will be selected.
    • Select rows and columns:  The whole column and line will be selected.
  • Frame around selected cells:  A selected cell gets surrounded by a frame.
  • Variable for selection X, Variable for selection Y: Here you each can enter a project variable, which will indicate the X- resp. Y-Index of the selected table cell.

Example: Create a table element visualizing the array of a structure

TYPE strucTab     :

STRUCT

iNo: INT;   bDigi : BOOL;   sText:STRING;   byDummy: BYTE;

END_STRUCT   END_TYPE

In PLC_PRG define the following array:

arr1:ARRAY     [1..5] OF strucTab;

and the following variables:

selX:INT;

selY:INT;

Create a visualization object and insert a table element. Configure like follows:

Cat. Table: data array: “PLC_PRG.arr1”

Cat. Columns: Transfer the components iNo, bDigi, sText to the right window - In the right window perform a double-click on the first entry (PLC_PRG.arr1[INDEX].iNo) and in the dialog which will open, replace the default title by “Number”. Confirm with OK and also define new column titles for the other two entries (e.g. “Value” and “Text”).

Cat. ‘Selection’: Enter here at ‘Variable Selection X’: “PLC_PRG.selX” and at Variable Selection “Y: PLC_PRG.selY”. Activate option ‘Frame around selected cells’. Press button ‘Selection color’ and choose color ‘yellow’. Close the configuration dialog with OK. The table element now should be displayed as shown in the following:

../_images/3e3b4e174377ea6f0a33139006eab46b

At the left border the numbers of the array index, at the top the titles of the selected structure components. You can modify the column widths by placing the cursor on the separator between two columns and moving the mouse as soon as the cursor appears as a horizontal double-arrow. .

In online mode the current values of the array elements will be displayed in the table cells. As soon as you select a table cell by a mouse-click, it will get yellow-colored and surrounded by a frame. Example:

../_images/b19213384377eaae0a33139006eab46b