Configure Alarm table

The element 'Alarm table' is used to visualize alarms, which must be defined before in the TwinCAT PLC Control Alarm configuration.
As soon as the element gets inserted in the visualization object, the dialog 'Configure alarm table'. Besides the known categories for configuration of tooltip and security the following settings concerning display and selection in the table can be made:


Category Alarm table

Configure Alarm table 1:

Dialog for configuration of a alarm table, category Alarm table

Define what you want to get displayed in the alarm table:

Change alarm group: Press this button to get the selection tree of the alarm configuration, which offers all alarm groups currently defined. Choose the desired group (which even may contain just one alarm).

Priority: Define the priority for which you want to get displayed all alarms. Permissible range: 0 to 255.

Alarm classes: Mark a class which you want to get displayed and press button Add to add the class to the list in the window 'Alarm classes'. Do this for all required classes. In order to remove a marked entry from the alarm classes window press button Delete.

Activate options Column heading resp. Row heading, if the headings should be displayed in the alarm table.

Category Columns:


Define here, which of the columns (alarm parameters) should be displayed in the alarm table: The parameters are defined -- except for date and time (alarm is coming) and alarm state in the Configuration of the alarm groups: Bitmap, Date, Time, Expression, Value, Message, Priority, Type, Class, State, Target value (for alarm types DEV+ and DEV-), Deadband.

Configure Alarm table 2:

Dialog for configuration of an alarm table, category 'Columns'

Using the buttons ">", ">>", you can take single resp. all parameters from the left to the right window. The selection defined in the right window will be displayed in the alarm table. Using the buttons "<" resp. "<<" entries can be removed from the selection.
For each column you can open the dialog 'Configure columns' by a double-click on the entry in the right window. In this dialog Column header and Column width can be defined.

Category Settings for sorting:

Configure Alarm table 3:

Dialog for configuration of an alarm table, category 'Settings for sorting'

Define here according to which criteria the alarm table should be sorted:

Sort column: Sorting according to Priority, Alarm class, Date/Time or Alarm state

Sort order: Ascending or Descending; Example: Ascending according to priority means that the table will start with alarms of priority 0 (if available), followed by higher numbered priorities.

Category Selection settings for alarm table:

Configure Alarm table 4:

Dialog for configuration of an alarm table, category 'Settings for alarmtable'

Define here some settings for the display for the chosen table fields:

Selection color: This button opens the standard dialog for choosing a color. Define the color in which selected fields should be displayed.

Row height: Height of the table rows in Pixel.

Slider size: Height of the slider (Pixel) at the bottom of the table.

Frame around selected rows: If this option is activated, selected table rows will get a frame.

Show statusline: If this option is activated, below the alarm table a status bar will be displayed providing the following buttons for the operation in online mode:

Acknowledge: All alarm entries marked in the alarm table get acknowledged.

Acknowledge all: All alarm entries listed in the alarm table get acknowledged.

History: If this button is pressed, instead of the current status of the alarms the table will show a complete list of all events which have occured up to now (all transitions between any alarm stati). In this list no acknowledgement is possible ! Any new events will be added currently.
If you have defined a record file, also there you will find this history for all alarm classes, for which the action 'Save' has been activated.

Start: cancels Stop (see below)

Stop: The current update of the list with newly occurring events will be stopped until it is restarted by pressing button 'Start'.


Acknowledge variables: This option is only available as long as you have not chosen option 'Show statusline' (see above). If it is activated, the functions described above for the status string buttons can get controlled by variables. In order to define these variables, choose a function from the selection list and enter a project variable in the assigned edit field. Thus for example the acknowledgement of all alarms in online mode can be done by a rising edge of the assigned variable.

Trend

Configure Alarm table 5:

Dialog for configuration of a Trend element

The Trend element can be used to log the time dependent behaviour of variable values in the online mode. It can be compared with the trace functionality..The online presentation is done in a diagram, in case of logging to a text file each of the values is written to a separate line.
In the dialog for configuring visualization elements in category 'Trend' you can do the following settings :

Curve: X/t, horizontal axis = time axis, vertical axis = scale of values

Orientation: Left-right or Right.-left: The latest value will be displayed on the left/right side

Axis:

Horizontal axis:

Configure Alarm table 6:

Dialog for configuration of the horizontal axis in the trend element

Division lines: Activate option 'visible', if vertical division lines should be displayed which are elongating the scale marks. In this case define the 'Scale': The given number defines the interval between the division lines on the horizontal axis. Type (normal ___, dashed _ _ _, dotted ....., dashdotted _ . _ .) and color of the lines can be defined in dialogs which will open when you perform a mouse-click on the corresponding rectangle showing the currently set line type resp. color.

Scale: The shown range of the scale is determined by the entry for Duration. If here e.g. " T#20s0ms" is defined, the scale will display a period of 20 seconds. The Main division and the Sub scale division, which will be displayed by the means of long and short marks are to be defined according to the same syntax.

Degree of accuracy: Define here (in the standard format for dates, e.g. T#50ms) the interval for displaying the current values of the variables.

Legend: Here you define the display of the legend. Via button Font the standard dialog for setting the font will be opened. At Scaling define the distances between the particular letterings on the scale (e.g. T#4ms, if the scale markings should get a lettering each 4 milliseconds. The lettering will contain the time and/or date, depending on which options are activated. The desired format each can be defined in the field 'format'.

Variables: Here you can define project variables, which contain the zoom values resp. offset values for the horizontal scale. For example the offset of the display range of the horizontal axis will be set to "10" as soon as the variable assigned here gets value 10.

Symbol bar: If option use is activated, at the bottom of the element a horizontal symbol bar will be added, providing buttons for scrolling and zooming in online mode.

Configure Alarm table 7:

The simple arrow buttons will move the displayed range along the time axis step by step, the double arrow buttons will shift it to the end resp. start of the record. The zoom buttons allow a zooming of the horizontal scale step by step. To get a possibility to restore the original settings concerning zoom and offset, define the vertical symbol bar to get the 'home' symbol.

Vertical Axis

Configure Alarm table 8:

Dialog for configuration of the vertical axis in the trend element

Division lines: corresponding to the horizontal axis (see above)

Scale: Define whether the scale should be displayed at the left or right border of the trend diagram. Choose the Start value (lower end) and End value (upper end) of the scale as well as the Main and Sub scale divisions (longer and shorter markings will be displayed in the here defined distances).

Legend: Font and divisions; see above, horizontal axis

Variables: see above, horizontal axis

Symbol bar: see above, horizontal axis, additionally there is a "home" buttonConfigure Alarm table 9: for restoring the standard settings concerning zooming and offset of the axes.

Recording: Define here whether the trend should be recorded 'only online', i.e. the time dependent behaviour of the variable values will be displayed using the chosen range of the scale, or whether the record should be saved to history file, which can be configured after pressing the button 'History'. The dialog corresponds to that which is used for the configuration of the alarm log file. In the log file for each time of measurement a separate line is written which contains the name and the values of all regarded variables. Each line starts with a unique identifier in DWORD format, which is built from the date of measuring.

Choose variable: Press this button to get the dialog Variables, where you can configure the variables for which the trend record should be done and how they should be displayed.

Enter a project variable in column Variable (mouse-click on the field will open an edit frame). It is recommended to use the input assistant <F2> or Intellisense function.

Color and Line type for the display of the variable in the record you can define by a mouse-click on the corresponding field in column Color (standard dialog for choosing a color) resp. by selecting a line type in the corresponding field of column Line type (normal ___, dashed _ _ _, dotted ....., dashdotted _ . _ .)

.Configure Alarm table 10:

Dialog for doing the curve configuration for the trend element

In column Marker you can define a variable, which will provide the currently recorded value when you use the marker function in online mode. The marker will be displayed as a little grey triangle in the upper left corner of the diagram. If you click on the triangle and keep the mouse-button pressed, you can shift a vertical marker line along the horizontal time axis. The variable defined as 'marker' then will read the corresponding value from the record curve of the associated project variable.

Do the settings for all variables you want to record. Via button Add a further line will be added at the end of the list. A line can be deleted by button Delete.

Curve configuration: This button opens the dialog Curve configuration. Here some settings concerning the trend curves can be done:


Configure Alarm table 11:

Dialog for doing the curve configuration for the trend element

Curve type: Select one of the options Straight line, Steps or Points. For the first two types the display of Additional points can be defined. For displaying a point a bitmap can be defined, otherwise a filled rectangle (same color as curve) will be used as point symbol. Press the rectangle next to Bitmap to get the standard dialog for selecting a bitmap file. Via Delete the currently set bitmap can be removed from the configuration.

Tolerance band: You can define an upper and lower limit value on the vertical axis to be displayed as a tolerance band. For each band a color (Press the color rectangle to get the selection dialog) can be defined. If the bands should be displayed in online mode, activate option Tolerance band as line. If you want the curve to get displayed in the color defined for the respective band as soon as exceeding the tolerance value, activate Curve color outside tolerance like tolerance band. Activate Both or None if you want to activate both or none of the above described display options at a time.

Example:

Display of a trend element in online mode:


1. Declaration in program PLC_PRG:

VAR 
    n: INT; 
    rSinus:REAL; 
    rValue:REAL; 
    rSlider1:REAL; (*für Lesezeichenfunktion*) 
    rSlider2:REAL; (*für Lesezeichenfunktion*) 
END_VAR 

2. Program part of PLC_PRG:

n:=n+1; 
rValue := rValue + 0.01; 
rSinus:=SIN(rValue)*50 + 50; 
IF n>100 THEN 
n:=0; 
END_IF 

3. Configuration of a trend element in a visualization

Orientation Left-Right, History activated
Horizontal axis: Division lines: T#2s, Duration: T#10s, Main: T#1s, Sub scale: T#500ms, Degree if accuracy: T#200ms, Legend: Time Format ('hh':'mm':'ss'), Scaling T#2s. Symbol bar activated.
Vertical axis: Division lines visible, Scale: 10, dotted, grey; Scale left, Start: 0, End: 100, Main: 10, Sub scale: 5; Legend: 10; Symbol bar activated.
Variables:
1. Variable PLC_PRG.rsinus, blue line, Marker: PLC_PRG_TRD.rSlider1;
2. Variable PLC_PRG.n, red line, Marker: PLC_PRG_TRD.rSlider2
Curve configuration: Straight line, no tolerance band

Configuration of two display fields for the current record values provided by the marker variables:

Rectangle element 1: Category Text: insert "%s" in the Content field; Category Variables: insert in field Textdisplay: PLC_PRG.rSlider1
Rectangle element 2: Category Text: insert "%s" in the Content field; Category Variables: insert in field Textdisplay: PLC_PRG.rSlider2
(additionally insert a rectangle element at the left border of the rectangle elements 1 and 2, showing the curve color of the corresponding record variable)

Result in online mode after login and start of the program:

Configure Alarm table 12:

The record is running from the left to the right; the latest value is shown on the leftmost position; every 200 milliseconds the current value will be added to the display. The arrow buttons in the symbol bars allow shifting the displayed time range. Using the simple arrow buttons you can shift step by step, using the double arrows you get to the end resp. start of the record. For example: if you go to the start of the record by pressing the double arrows pointing to the left, you get a still display of the former values. If you then move the marker (grey triangle in the upper left corner) along the time axis, you can read the exact values of each of the both recorded variables for each time in the rectangle elements below the diagram.

Bitmap

You can enter the options for a bitmap in the Bitmap category within the visualization element configuration dialog box.

Enter the bitmap file and its path in the Bitmap field. You can use the ... button to open the standard Windows Browse dialog box from which you can select the desired bitmap.

All other entries affect the frame of the bitmap.

By selecting Anisotropic, Isotropic or Fixed you specify how the bitmap should react to changes in the size of the frame. Anisotropic means that the bitmap remains the same size as the frame which allows you to change the height and width of the bitmap independently. Isotropic means that the bitmap retains the same proportions even if the overall size is changed (i.e., the relationship between height and width is maintained). If Fixed is selected, the original size of the bitmap will be maintained regardless of the size of the frame.

If the Clip option is selected together with the Fixed setting, only that portion of the bitmap that is contained within the frame will be displayed.

If you select the Draw option, the frame will be displayed in the color selected in the Color and Alarm color buttons in the color dialog boxes. The alarm color will only be used if the variable in the Change Color field in the Variable category is TRUE.

In the selection list in the lower part of the dialog you can define whether the bitmap should be inserted in the project (Insert) or whether just a link to an external bitmap-file (path as entered above in the 'Bitmap' field) should be created (Link to file). It is reasonable to keep the bitmap file in the project directory, because then you can enter a relative path. Otherwise you would enter an absolute path and this might cause problems in case you want to transfer the project to another working environment.

Configure Alarm table 13:

Visualization Element Configuration Dialog Box (Bitmap Category)

Visualization

When you insert a visualization as an element in another visualization, you are creating a "reference" of the visualization.
The configuration of this reference can be done in the Visualization category within the visualization element configuration dialog box.
Configure Alarm table 14:

Visualization Element Configuration Dialog Box ( Visualization Category)

Enter the object name for the visualization, which should be inserted, in the Visualization field. Use the ... button to open a dialog box containing the visualizations available in this project. Any visualization may be used with the exception of the current one.

The following entries affect the visualization frame.

The Placeholder button leads to the 'Replace placeholder' dialog. It lists in the 'Placeholder' column all the placeholders which had been inserted in the configuration dialogs of the "mother"-visualization and offers in the 'Replacements' column the possibility of replacing these for the current reference with a definite value. Which replacements are possible in a given case depends on whether a value group was predefined in the 'Extras' 'Placeholder list' dialog in the "mother"-visualization. If this is the case, it will be displayed in a combo box for selection. If nothing was pre-defined, double clicking on the corresponding field in the Replacements column opens an editing field which can be filled in as desired.

A further possibility for replacing placeholders in references occurs directly when you define the call of a visualization by an entry into the Zoom to vis. option field in the configuration dialog ('Input' category).

Configure Alarm table 15:

No control of the chronological sequence of replacements is possible! Therefore no placeholders should be replaced with text that also contains placeholders!

Configure Alarm table 16:

When using placeholders it is no longer possible to check for invalid entries in the configuration of the visualization element immediately upon compilation of the project. Hence the appropriate error messages are first issued in Online mode (...Invalid Watch expression..).

Notice

Online behaviour of a visualization reference:

If you insert a visualization and then select and configure this reference, it will be regarded as a single object and in online mode will react to inputs correspondingly to its configuration. In contrast: if you do not configure the reference, then in online mode its particular visualization elements will react exactly like those of the original visualization

Example of an application of the placeholder concept:

Instances of a function block can easily be displayed with the help of references of the same visualization. For example, in configuring the visualization visu, which visualizes the variables of function block, one could begin each variable entry with the placeholder $FUB$ (e.g. $FUB$.a). If a reference from visu is then used (by inserting visu in another visualization or by calling via 'Zoom to vis.'), then in the configuration of this reference the placeholder $FUB$ can then be replaced with the name of the function block instance to be visualized.

This might look like shown in the following:

In the project define a function block containing the following declarations:

FUNCTION_BLOCK fu
VAR_INPUT
    changecol : BOOL; (* should cause a color change in the visualization *`)
END_VAR

In PLC_PRG define two instances of 'fu':

inst1_fu : fu;
inst2_fu : fu;

Create a visualization object 'visu'. Insert an element and open the configuration dialog, category 'Variables'. Enter in field 'Change color' the following: "$FUB$.changecol". Open category 'Input' and enter in field 'Tap Variable' "$FUB$.changecol". Open category 'Text' and enter"$FUB$ - change color ".

Create another visualization object 'visu1'.

Insert visualization 'visu' twice in 'visu1' (two references of 'visu').
Mark the first reference of 'visu' and open the configuration dialog of category 'Visualization'. Press button 'Placeholder', so that the placeholder list will be displayed. There replace entry 'FUB' by 'PLC_PRG.inst_1'.
Now mark the second reference of 'visu' and (like described for the first one) replace 'FUB' by 'PLC_PRG.inst_2'.
Now in online mode the values of the variables which are used to configure the two instances of 'fu' will be visualized in the corresponding reference of 'visu'.

Of course the placeholder $FUB$ can be used at all places in the configuration of 'visu' where variables or text strings are entered.