Tag table
The tag table shows tags as rows, like the WinCC table control. Rows are set on the “Rows and columns” tab (each with a title, decimals, units, limits, a bar, a color and input) and/or by a name mask: Tank1.*; Pump?.Run. Columns are name, description, value, units, quality, time, a fill bar and the limit state; widths, headers and alignment are your own. The operator sorts by clicking a header, searches by name, copies and saves to CSV, and enters values from a row if input is allowed.
A script sees the rows in display order, selects a row, sets the search and sorting. The operator’s selection is the “Row selected” event, value input is “Value change”.
Properties
Section titled “Properties”Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:
| Property | Values | Default | Description |
|---|---|---|---|
Mask |
text | Tags by mask. Add tags by mask to the rows, separated by «;»: Tank1.*; Pump?.Run. Empty — only rows of the «Rows and columns» tab | |
ShowComment |
true / false |
true |
Comment. Tag comment column (if columns are not set) |
ShowQuality |
true / false |
false |
Quality. Quality column (if columns are not set) |
Caption |
text | Title. Line above the table; empty — none | |
Decimals |
integer | Decimal places. For numeric values; empty — as received from the server | |
Writable |
true / false |
false |
Input. Value input from the row (if permitted) |
InputMode |
DoubleClick, SingleClick |
DoubleClick |
Input on. Double or single click on the row |
Sortable |
true / false |
true |
Sorting by operator. Clicking a column header sorts the rows |
ResizableColumns |
true / false |
true |
Column width by operator. The operator changes column width and order |
ShowFilter |
true / false |
false |
Search. Search box by name and caption above the table |
ShowToolbar |
true / false |
false |
Export buttons. Copy and save to CSV — for the operator |
HighlightChanges |
true / false |
false |
Highlight changes. A changed value is highlighted for a second |
ShowHeader |
true / false |
true |
Header row |
GridLines |
None, Horizontal, Vertical, All |
Horizontal |
Grid lines |
RowHeight |
number | Row height. Empty — by font | |
FontFamily |
text | Font. For example Segoe UI, Consolas, Arial; empty — Segoe UI | |
FontSize |
number | 13 |
Font size |
Foreground |
#RRGGBB |
Text color | |
Background |
#RRGGBB |
Background | |
AlternateBackground |
#RRGGBB |
Even rows background. Alternating rows; empty — as background | |
HeaderBackground |
#RRGGBB |
Header background | |
HeaderForeground |
#RRGGBB |
Header text | |
GridColor |
#RRGGBB |
Grid color | |
SelectionBackground |
#RRGGBB |
Selection color | |
BorderColor |
#RRGGBB |
Border color | |
BorderWidth |
number | 1 |
Border width |
ValueColor |
#RRGGBB |
Value color. «Value» column; empty — as text | |
HighLimitColor |
#RRGGBB |
#FADBD8 |
Background above limit. Row where the value is above the high limit |
LowLimitColor |
#RRGGBB |
#E3EEF8 |
Background below limit. Row where the value is below the low limit |
BarColor |
#RRGGBB |
#2F6FB0 |
Bar color |
From scripts
Section titled “From scripts”Item.Type = TagTable. Any property is read and changed by name: Item.Foreground = "#D32F2F". The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.
Actions of this element:
| Member | Description |
|---|---|
Tags() |
Tags of the rows in display order |
Selected |
Tag of the selected row; null — none |
Select(tag) |
Select a row by tag; null — clear the selection |
Filter |
Search text |
SetFilter(text) |
Filter rows by name and title |
Sort(column, descending) |
Sorting: Sort(“Value”, true); Sort(null) — project order |
Text(separator) |
The table as text, columns separated by tabs |
SaveCsv() |
Save to CSV — the operator sees the save dialog |
Events
Section titled “Events”Mouse, hover, focus and keyboard — as for any element (see Events and functions). Its own events:
- Value change (
Change) — The operator entered a new value. - Row selected (
SelectionChanged) — The operator selected another row, alarm or tab; the selection is in Item.Selected.
Examples
Section titled “Examples”A trend of the selected tag — the table’s “Row selected” event switches the neighboring trend.
var t = Screen.Items("Trend1");t.Apply({ penList: [{ tag: Item.Selected }] });Largest values on top — a “Descending” button.
Screen.Items("Values").Sort("Value", true);Filter by area — the script fills the search field.
Screen.Items("Values").SetFilter("Tank" + Tags("Tank.Selected").Value);