Add a message to an alarm

<< Click to Display Table of Contents >>

Manual > Monitoring system construction guide > Establishing major functions > Alarms > Customizing alarms >

Add a message to an alarm

overview

Here we will introduce a customization example of adding a comment column to the standard alarm function.

 

Customization details

 

•Add [CM3] as "Additional comment" to the alarm master.

•A new "Additional Comments" column will be added to the alarm summary screen.

•On the alarm history screen, the contents of the "Additional comments" are linked and displayed in the "Message" column.

 

(Example of alarm summary display)

p_alarm_0085

 

(Example of alarm history display)

p_alarm_0086

 

 

Download the sample

The creation examples shown on this page are provided with samples.

 

The sample can be downloaded from below.

 

 

 

Procedure

■Editing the alarm master

 

First, add a comment to the alarm master.

 

1.Open Alarm Master

 

Open "master.csv" in the following folder of the target project.

 

(Project folder)\server\alarm\master.csv

 

Below is an example of the standard alarm master layout with three alarms set (※The following is an example opened in Excel).

 

p_alarm_0088

 

 

2.Editing an Alarm Master

 

Add a new [CM3] to the end of the column above. For example, edit as follows:

 

p_alarm_0087

 

When editing the alarm master in Excel, save it in CSV format.

 

Below is an example edited in Notepad.

 

p_alarm_0089

 

 

■Edit the layout of the alarm summary

 

Next, edit the layout of the alarm summary screen.

 

1.Select the alarm summary screen in Panel Editor

 

In the left tree of Panel Editor where the project you want to edit is open, open the _AlarmSummary folder under Client and select the "_Main" form.

 

p_alarm_0090

 

 

2.Editing Remote Alarm Grid Properties

 

Double-click on the remote alarm grid located in the center of the alarm summary screen.

 

p_alarm_0091

 

A settings dialog will then appear, so click the edit button for "Layout" (AlarmLayout property).

 

p_alarm_0092

 

This will open a properties editor where you can edit the alarm layout.

 

p_alarm_0093

 

The alarm layout definition format consists of two rows of parameters for each column of the grid.

 

In the first line, specify the format of the fields to be displayed in the column, and in the second line, specify the column title, width (in pixels), and text alignment (center/left/right).

 

Here, edit as follows and save with the OK button.

 

•Change the message width of [CM0] from 2000 to 250

•Add two new lines to define [CM3] (set the width to 2000).

 

 

 

 

■ Edit the layout of alarm history

 

Next, edit the layout of the alarm history screen.

 

1.Select the Alarm History screen in Panel Editor

 

In the left tree of Panel Editor where the project to be edited is open, open the _AlarmHistory folder under Client and select the "_Main" form.

 

p_alarm_0094

 

 

2.Editing Remote Alarm Grid Properties

 

Double-click on the remote alarm grid located in the center of the alarm history screen.

 

p_alarm_0095

 

A settings dialog will appear, so click the edit button for "Layout" (AlarmLayout property).

 

p_alarm_0096

 

Then the editor will appear.

 

p_alarm_0097

 

You can edit the alarm layout from this editor just like you can from the alarm summary screen.

 

For the alarm history, we will try a different method than we did for the alarm summary. In this example, instead of adding a column, we will concatenate multiple comments in one column using an expression and display them as a message.

 

Edit it as follows and save it by clicking OK.

 

Before editing)

[CM0]

Message, 2000, left

 

After editing)

[CM0] & " " & [CM3]

Message, 2000, left

 

*Write the above formula in the line that previously said [CM0].

 

 

 

Operation check

Now let's check how it works.

 

Click Online (yellow arrow) at the top of the Panel Server screen.

Next, click the browser run icon (green arrow) at the top of the Panel Editor screen to call up Panel Browser.

 

Once Panel Browser is running, display the alarm summary screen.

 

p_alarm_0098

 

First, make sure that the grid on the alarm summary screen has the new column called "Additional Comments" that you just added.

 

p_alarm_0099

 

Next, try writing TRUE to U01.F01.M0000, one of the tags registered in the alarm, from Panel Server.

 

p_alarm_0100

 

The newly added CM3 comment was then displayed on the alarm summary screen.

 

p_alarm_0085

 

*Please check all at once from the alarm summary screen.

 

If you look at the message column on the alarm history screen, you can see that the additional comment defined in CM3 is added and displayed after the alarm comment before the change, "Alarm 001."

 

p_alarm_0086

 

In this way, in addition to adding new columns to the content displayed in the alarm grid, you can also concatenate the contents of multiple comments in a single column.

 

 

supplementary explanation

■About alarm fields

 

In the alarm function (and event function), "field names" are used to define display columns for the alarm grid on the screen.

 

For example, the "AlarmLayout" property of the remote alarm grid on the standard alarm summary screen is written as follows:

 

 

(AlarmLayout property)

[ALARMID]

AlarmID, 80, center

 

[OCCURDATESTR]

Occurrence, 140, center

 

[ARDATESTR]

Check/Return, 140, center

 

[CM1]

Alert level, 100, center

 

[CM0]

Message, 2000, left

 

The above "[ALARMID]" and "[OCCURDATESTR]" are alarm fields. In this example, the first column of the alarm grid is the alarm ID, the second column is the occurrence date and time, the third column is the confirmation and recovery date and time, the fourth column is CM1 (the alarm level in the standard alarm function), and the fifth column is CM0 (also the alarm message).

 

 

hint

For more information about alarm field names, see "About Field Names".

 

 

■Alarm layout formula syntax

 

When defining an alarm layout, you can write expressions that include field names.

 

For example, if you write it as follows, the contents of CM0 and CM3 will be concatenated and displayed.

 

[CM0] & [CM3] ... The "&" operator can perform bitwise AND operations as well as string concatenation.

 

[CM0] & " " & [CM3] ... Concatenates strings enclosed in double quotation marks (in this example, a half-width space).

 

[CM0] & "(" & [CM3] & ")" ... The contents of CM3 will be displayed enclosed in half-width brackets.

 

In addition, you can also branch the display content using conditional expressions (for an example of using conditional expressions, see "Including tag values in alarm messages").

 

 

hint

Details regarding the expression syntax are described in "Expression syntax".

 

 

■To edit the layout of the alarm summary at the bottom of the screen

 

The alarm summary is always displayed at the bottom of the standard framework screen. If you want to change the layout of this alarm summary display as well, you can do so in the same way as you edit the layout of the alarm summary screen.

 

In this case, the form to be edited is the "frmAlarm" form stored in the Forms folder.

 

p_alarm_0101

 

(Remote Alarm Grid in frmAlarm form)

p_alarm_0102