ALARMDISPLAY

Concept Link IconSee also Concept Link IconExample Concept Link IconFurther information

Alarm Viewer management including list navigation, actions on alarms and filtering.

Partial WebVue support - See the table with the list of modes below. Not supported modes return an unsuccessful code if used in this context.

If using a project with multiple regions, you must set the region before executing any instructions that interacts with the HMI. For further information, see the REGION topic.

Mode Mnemonic Syntax WebVue support
0 BEGIN 1 Yes
1 BEFORE 1 Yes
2 SELECT 8 No
3 AFTER 1 Yes
4 END 1

Yes

5 LINEUP 1 Yes
6 LINEDOWN 1 Yes
7 MODE 1 No
8 DYNAMIC 1 No
9 DOMAIN 2 Yes
10 NATURE 2 Yes
11 MINPRIO 3 Yes
12 MAXPRIO 3 Yes
13 ACK_ON 4 Yes
14 ACK_OFF 4 Yes
15 NOACK_ON 4 Yes
16 NOACK_OFF 4 Yes
17 NS 4 Yes
18 SELECTED 5 Yes
19 SELECNAME 5 Yes
20 ACTION1 1 No
21 ACTION2 1 No
22 FORMAT 15 No
23 USERMASK 4 Yes
24 LIST 1 No
25 PRINTALL 1, 11 No
26 FILTER 7 Yes
27 ACK_SELECTED 1 Yes
28 ACK_DISPLAY 1 Yes
29 MASK_SELECTED 1 Yes
30 UNMASK_SELECTED 1 Yes
31 PRINT_SELECTED 1, 11 No
32 PRINT_DISPLAY 1, 11 No
33 PROGMASK 4 Yes
34 VARMASK 4 Yes
35 IS_ACTION1 1 No
36 IS_ACTION2 1 No
37 DATERANGE 6 No
38 MAINTENANCEMASK 4 Yes
39 UNSELECTALL 1 Yes
40 ONLINESELECT 9 Yes
41 SELECDATETIME 10 No
42 MASK_DISPLAY 1 Yes
43 UNMASK_DISPLAY 1 Yes
44 LINESELECT 12 Yes
45 SETSORT 13 Yes
46 GETSORT 14 Yes
47 ISLINEVISIBLE 16 No
48 ISLINESELECTED 16 No
49 GETLINECOUNT 1 No
50 GET_NAME_FROM_LINE 17 No
51 COPY_CLIPBOARD 18 No
52 GETCELL 20 No
53 GETLINES 19 No
54 GETSELECTEDLINES 19 No
57 SETCOLUMNWIDTH 21 No
58 GETCOLUMNWIDTH 22 No

Arguments for all modes

Argument

Meaning

Window

The name of the window that contains the Alarm Viewer to be used. Type STR.

Branch

The branch (if any) of the window. Use "#B" to indicate the current branch of the program. Type STR

Identity

The identity of the Alarm Viewer animation in the specified window. Type STR.

Syntax 1

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity);

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

0

BEGIN

Go to the start of the list (oldest alarm).

1

BEFORE

Scroll list up one page.

3

AFTER

Scroll list down one page.

4

END

Go to end of list (newest alarm).

5

LINEUP

Scroll list up one line.

6

LINEDOWN

Scroll list down one line.

7

MODE

Change from scroll mode to list mode.

8

DYNAMIC

Change to scroll mode.

20

ACTION1

Execute the action no. 1 associated with the selected alarm.

21

ACTION2

Execute the action no. 2 associated with the selected alarm.

24

LIST

Change from any mode to list mode.

25

PRINTALL

Print the entire contents of the current buffer on the printer configured in the Alarm Viewer.

27

ACK_SELECTED

Acknowledge the selected alarm.

28

ACK_DISPLAY

Acknowledge all alarms visible in the display.

29

MASK_SELECTED

Mask the selected alarm.

30

UNMASK_SELECTED

Unmask the selected alarm.

31

PRINT_SELECTED

Print the selected alarm.

32

PRINT_DISPLAY

Print all alarms visible in the display.

 

 

Return for all modes above: 1 if successful, else 0.

35

IS_ACTION1

Check whether the selected alarm has a configured associated Action1.

Return : 1 if OK, else 0 (window cannot be found, incorrect type of animation, identity cannot be found).

36

IS_ACTION2

Check whether the selected alarm has a configured associated Action2.

Return : 1 if OK, else 0 (window cannot be found, incorrect type of animation, identity cannot be found).

 

 

Return for modes 35 and 36:
1 if an action is configured
0 if no action is configured or if executed in WebVue context
-1 if no alarm is selected.

39

UNSELECTALL

Deselects all lines of the display.

42 MASK_DISPLAY Mask all alarms visible in the display.
43 UNMASK_DISPLAY Unmask all alarms visible in the display.
49 GETLINECOUNT Return the number of lines in the display.

 

 

Return for all modes unless noted otherwise: 1 if successful, else 0 (window cannot be found, incorrect type of animation, non-existent position, executed in WebVue context and not supported).

Syntax 2

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Name);

Return type: INTEGER.

Argument

Meaning

Name

The name of the new Domain or Nature for the Alarm Viewer. To specify all Domains and all Natures, Name must be a null string "". Type STR.

Execution

Select a new Domain or Nature for the Alarm Viewer.

Mode

Mnemonic

Action

9

DOMAIN

The argument Name supplies a new Domain.

10

NATURE

The argument Name supplies a new Nature.

 

  Return for all modes: 1 if successful, else 0.

Syntax 3

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Priority);

Return type: INTEGER.

Argument

Meaning

Priority

The new priority level for the alarm filter.

Priority must be a numerical type. If Priority is out of range (<0 or >29) the function returns 0.

Execution

Select a new minimum or maximum alarm priority for the alarm filter.

Mode

Mnemonic

Action

11

MINPRIO

The argument Priority supplies a new minimum priority.

12

MAXPRIO

The argument Priority supplies a new maximum priority.

 

  Return for both modes: 1 if successful, else 0.

Syntax 4

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Flag);

Return type: INTEGER.

Argument

Meaning

Flag

An integer which when set to 1 will activate, and when set to 0 will deactivate, the selected mode.

Execution

Enable and disable alarm states in the alarm filter.

Mode

Mnemonic

Action

13

ACK_ON

Alarm state ON ACKNOWLEDGED.

14

ACK_OFF

Alarm state OFF.

15

NOACK_ON

Alarm state ON NOT ACKNOWLEDGED.

16

NOACK_OFF

Alarm state OFF NOT ACKNOWLEDGED.

17

NS

Alarm state INVALID.

23

USERMASK

Alarm state MASKED.

33

PROGMASK

Alarm state MASKED BY PROGRAM.

34

VARMASK

Alarm state MASKED BY VARIABLE.

38

MAINTENANCEMASK

Alarm state MAINTENANCE.

 

  Return for all modes: 1 if successful, else 0.

Syntax 5

StrVal = ALARMDISPLAY(Mode, Window, Branch, Identity);

Return type: STR.

Execution

Mode

Mnemonic

Action

18

SELECTED

Return the ID of the last selected alarm on the display. This is used in conjunction with ALARMDISPLAY mode 7 (MODE).

19

SELECNAME

Return the name of the last selected alarm on the display. This is used in conjunction with ALARMDISPLAY mode 7 (MODE). A selected alarm is shown in reverse video.

Syntax 6

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, StartDate, EndDate);

Return type: INTEGER.

Argument

Meaning

StartDate

The start date for selection, expressed as the number of milliseconds since 1980. See the instruction DateTimeValue.

EndDate

The end date for selection, expressed as the number of milliseconds since 1980. See the instruction DateTimeValue.

Execution

Mode

Mnemonic

Action

37

DATERANGE

Selects the current realtime alarms by date and time and displays them in the animation.

 

 

Return: 1 if OK, else 0 (window cannot be found, etc.)

To cancel the filter, you must set Start Date and End Date to 0.

For particular cases:

if only the Start Date is set (i.e. if End Date is 0): the animation will display only alarms from the Start Date onwards, plus those occurring in real time up to the number of alarms set in the list.

If only the End Date is given (i.e. if Start Date is 0): the animation will return only alarms occurring since the oldest effective one, up to the End Date and subject to the number of alarms set in the list).

Syntax 7

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Filter);

Return type: INTEGER.

Argument

Meaning

Filter

A filter expression. You can use either a Native Filter Expressions or SQL Expression to filter the list of variables Type STR.

Execution

Mode

Mnemonic

Action

26

FILTER

Selects information to be displayed, by applying the filter expression.

 

 

Return: 1 if successful, else 0 (window cannot be found, etc.).

Syntax 8

IntVal =ALARMDISPLAY(Mode, Window, Branch, Identity, AlarmName, Selected );

Return type: INTEGER.

Argument

Meaning

AlarmName

The name of the alarm to which the selected line refers.

Selected

Required state of the line: selected (0), not selected (1).

Execution

Mode

Mnemonic

Action

2

SELECT

Select or de-select a line of the Alarm Viewer, in List mode.

 

 

Return: 1 if successful, else 0 (window cannot be found, incorrect type of animation, non-existent position, variable not found).

Syntax 9

IntVal =ALARMDISPLAY(Mode, Window, Branch, Identity, Program, Branch, Function[, Farg]);

Return type: INTEGER.

Argument

Meaning

Program

The program to be used.

Function

The function to be run.

Farg

Contains from 1 to 8 arguments separated by "," (comma) (optional, maximum 255 characters).

You can use the GETARG command, at the beginning of the function that is to be ran, to retrieve the values of the arguments contained in Farg.

Execution

Mode

Mnemonic

Action

40

ONLINESELECT

Respond to the event of selection of a line. Enables you to specify a function that will be run when a line in the display animation is selected, either by mouse click or by program with mode SELECT.

 

 

Return: 1 if successful, else 0 (window cannot be found, incorrect type of animation, non-existent position).

Syntax 10

DblVal =ALARMDISPLAY(Mode, Window, Branch, Identity);

Return type: DOUBLE.

Execution

Mode

Mnemonic

Action

41

SELECDATETIME

Retrieve the date-time of the most recently selected alarm in an Alarm Viewer.

 

 

Return: The date and time as the number of milliseconds since the 1st January 1980, or 0 in case of error (no alarm selected, window cannot be found, incorrect type of animation, non-existent position).

The instruction's mnemonic is 'SELECDATETIME' (not 'SELECT...').

Syntax 11

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity[, PrintFormat]);

Return type: INTEGER.

Argument

Meaning

PrintFormat

Optional parameter for selecting the format for printing:

0: Print the alarms using the display format defined in the Alarm Viewer's Display tab. (default).

1: Print the alarms using the print format defined in the Alarm Viewer's Execution tab.

Execution

Mode

Mnemonic

Action

25

PRINTALL

Print the entire contents of the current buffer on the printer configured in the Alarm Viewer.

31

PRINT_SELECTED

Print the selected alarm.

32

PRINT_DISPLAY

Print all alarms visible in the display.

 

 

Return for these modes: 1 if successful, else 0.

Syntax 12

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Program, ProgramBranch, Function, Arguments);

Return type: INTEGER.

Argument

Meaning

Program

Module of the program to be executed.

ProgramBranch

Branch for the program.
Function Function of the program to be executed.
Arguments Arguments for the program.

Execution

Mode

Mnemonic

Action

44

LINESELECT

Specifies a program to be executed when a line select/unselect occurs.

 

 

Return: 1 if successful, else 0 (incorrect parameter...).

The XMLPATH instruction is used to get information about the LINESELECT mode. A namespace is created automatically using Branch, Window and Identity parameters. See the topic on XMLPATH for its format.

The meanings of the XML paths are as follows.

Path

Meaning

lineselect/variable Variable name.
lineselect/x X position
lineselect/y Y position
lineselect/selected Selected/unselected
lineselect/time Date-time
lineselect.element[1-8].value Column element

Syntax 13

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Column, Sort);

Return type: INTEGER.

Argument

Meaning

Column

Values 0 to 7 to identify the column, -1 to reset the sort.

Sort

Values 1 for ascending, 0 for descending.

Execution

Mode

Mnemonic

Action

45

SETSORT

Dynamically sort an alarm list by a column.

 

 

Return: 1 if successful, else 0 (incorrect parameter...).

Syntax 14

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Column, Sort);

Return type: INTEGER.

Argument

Meaning

Column

Values 0 to 7 to identify the column, -1 to reset the sort.

Sort

Values 1 for ascending, 0 for descending.

Execution

Mode

Mnemonic

Action

46

GETSORT

Obtain the status of the sort.

 

 

Return: 1 if successful, else 0 (incorrect parameter...).

The XMLPATH instruction is used to get information about the LINESELECT mode. A namespace is created automatically using Branch, Window and Identity parameters. See the topic on XMLPATH for its format.

The meanings of the XML paths are as follows.

Path

Meaning

getsort/column Values 0 to 7 to identify the column, -1 to reset the sort.
getsort/sort Values 1 for ascending, 0 for descending.

Syntax 15

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, DateFormat);

Return type: INTEGER.

Argument

Meaning

DateFormat

A string defining a new display format for dates in the alarm data.

Execution

Mode

Mnemonic

Action

22

FORMAT

Select a new display format for the Alarm Viewer. The argument DateFormat supplies a new display format.

An example of its syntax is as follows: #h:#m:#s\t#D/#M/#y\t#T\t#E
where \t marks the start of each column and the substitution strings are those used in configuring an alarm viewer.

It is not possible to change the column titles dynamically.

Return: 1 if successful, else 0.

Syntax 16

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, LineNumber);

Return type: INTEGER.

Argument

Meaning

LineNumber

A number corresponding to the line position.

Execution

Mode

Mnemonic

Action

47

ISLINESELECTED

Test if the given line is selected.
Return: 1 if the line is selected, 0 if the line is not selected or if executed in WebVue context, -1 if the line does not exist.

48 ISLINEVISIBLE Test if the given line is visible.
Return: 1 if the line is visible, 0 if the line is in the buffer but not visible or if executed in WebVue context, -1 if the line does not exist

Syntax 17

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, LineNumber);

Return type: STRING.

Argument

Meaning

LineNumber

A 1 based number corresponding to the line position.

Execution

Mode

Mnemonic

Action

50

GET_NAME_FROM_LINE

Return the alarm name for the given line or an empty string in case of error.

Syntax 18

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Separator);

Return type: INTEGER.

Argument Meaning
Separator The character or characters used to delimit the contents of each column. Type STR.

Execution

Mode Mnemonic Action
51 COPY_CLIPBOARD Copy the selected lines to the Windows clipboard.
Return: 1 if successful, else 0

Syntax 19

StrVal = ALARMDISPLAY(Mode, Window, Branch, Identity, LineStart[, LineEnd, ColSeparator, LineSeparator]);

Return type: STR.

Argument Meaning
Linestart The 1 based numeric index of a line in the Alarm Viewer buffer. Type INTEGER.
LineEnd The 1 based numeric index of a line in the Alarm Viewer buffer. Type INTEGER.
ColSeparator The character or characters used to separate the columns in the returned string. The default is the comma ",". Type STR.
LineSeparator The character or characters used to separate the lines in the returned string. The default is new line "\n". Type STR.

Execution

Mode Mnemonic Action
53 GETLINES Return the lines from LineStart to LineEnd (inclusive) as a single string delimited using the ColSeparator and LineSeparator characters. If LineEnd is omitted only a single line is returned with the columns delimited using the default characters.
Return: Selected lines of the Alarm Viewer.
54 GETSELECTEDLINES Same as GETLINES except that only selected lines are returned.
    Return an empty string in case of error.

Syntax 20

StrVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Line, Column);

Return type: STR.

Argument Meaning
Line The 1 based numeric index of a line in the Alarm Viewer buffer. Type INTEGER.
Column The 1 based numeric index of a column in the Alarm Viewer buffer. Type INTEGER.

Execution

Mode Mnemonic Action
52 GETCELL

Return the contents of the specified cell or an empty string in case of error.

Syntax 21

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Column, Width);

Return type: INTEGER.

Argument Meaning
Column 1 based numeric index of a column in the Alarm Viewer. Type INTEGER.
Width Column width in pixels. Range 0 to 3000. Type INTEGER.

Execution

Mode Mnemonic Action
57 SETCOLUMNWIDTH

Set the width of the specified column in pixels.
Return: 1 if successful, else 0.

Syntax 22

IntVal = ALARMDISPLAY(Mode, Window, Branch, Identity, Column);

Return type: INTEGER.

Argument Meaning
Column 1 based numeric index of a column in the Alarm Viewer. Type INTEGER.

Execution

Mode Mnemonic Action
58 GETCOLUMNWIDTH

Get the width of the specified column in pixels.

Example

For an example, select the Example link above. For syntaxes 12 and 14 in particular, see similar examples of LOGDISPLAY modes 23 and 25.