LOGDISPLAY
See also
Example
Further information
Log Viewer management including list navigation 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.
Population filtering based on the source is not supported to filter in log viewers (and log printing) when data are archived using a database archive unit (HDS).
Mode | Mnemonic | Syntax | WebVue support |
0 | BEGIN | 1 | Yes |
1 | BEFORE | 1 | Yes |
3 | AFTER | 1 | Yes |
4 | END | 1 | Yes |
5 | LINEUP | 1 | Yes |
6 | LINEDOWN | 1 | Yes |
9 | DOMAIN | 2 | Yes |
10 | NATURE | 2 | Yes |
11 | PRINTALL | 1, 8 | No |
12 | SETDATETIME | 3, 7 | Yes |
13 | FILTER | 4 | Yes |
14 | PRINTSELECTED | 1, 8 | No |
15 | PRINTDISPLAY | 1, 8 | No |
16 | FIRST | 1 | Yes |
17 | LAST | 1 | Yes |
18 | EVENTMASK | 6 | Yes |
19 | MINMAX | 5 | Yes |
20 | EXECUTE | 1 | Yes |
21 | LOGLIST | 2 | Yes |
22 | EVENTMASKEX | 12 | Yes |
23 | LINESELECT | 9 | Yes |
24 | SETSORT | 10 | Yes |
25 | GETSORT | 11 | Yes |
26 | AUTOREFRESH_SET | 17 | Yes |
27 | AUTOREFRESH_PAUSE | 1 | Yes |
28 | AUTOREFRESH_RESUME | 1 | Yes |
29 | ISLINESELECTED | 13 | No |
30 | ISLINEVISIBLE | 13 | No |
31 | GETLINECOUNT | 1 | No |
32 | COPY_CLIPBOARD | 14 | No |
33 | GETLINES | 15 | No |
34 | GETSELECTEDLINES | 15 | No |
35 | GETCELL | 16 | No |
36 | AUTOREFRESH_STATUS | 1 | No |
37 | AUTOREFRESH_PERIOD | 1 | No |
38 | GET_NAME_FROM_LINE | 18 | No |
39 | UNSELECTALL | 1 | Yes |
40 | SETCOLUMNWIDTH | 19 | No |
41 | GETCOLUMNWIDTH | 20 | No |
Common arguments
Argument | Meaning |
Window | The name of the Window in which the animation is embedded. Type STR |
Branch | The window branch. Use "*" for the branch of the current program. Type STR. |
Identity | Identity of the Log Viewer (from its configuration). Type STR |
DelayExecution | A flag indicating if the instruction is to be executed immediately (0) or whether it is to wait for an Execute instruction (1). |
Using the DelayExecution argument and the EXECUTE mode
Many of the filtering modes support the optional DelayExecution flag.
- If DelayExecution is omitted or is 0 then the instruction is executed immediately.
- If DelayExecution is 1, then the instruction execution is delayed until the next call to the mode Execute. This allows you to make several changes to a Log Viewer filter that are then all executed at the same time. As each time a Log Viewer filter is changed a new historical request is made, this avoids making multiple historical requests where one would is sufficient.
The following modes support the DelayExecution flag.
DOMAIN, NATURE, LOGLIST, SETDATETIME, FILTER, MINMAX, EVTMASK and EVENTMASKEX.
Syntax 1
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity);
Return type: INTEGER.
Execution
Mode | Mnemonic | Action |
0 | BEGIN | Request and display the previous buffer of data. Equivalent to the << button on the Log Viewer. |
1 | BEFORE | Scroll the list backwards by one page. Equivalent to the < button on the Log Viewer. |
3 | AFTER | Scroll list forwards by one page. Equivalent to the > button on the Log Viewer. |
4 | END | Request and display the next buffer of data. Equivalent to the >> button on the Log Viewer. |
5 | LINEUP |
Scroll list up one line. |
6 | LINEDOWN |
Scroll list down one line. |
11 | PRINTALL | Print the entire contents of the current buffer on the printer configured in the Log Viewer. |
14 | PRINTSELECTED | Print the selected line on the printer configured in the Log Viewer. |
15 | PRINTDISPLAY | Print all the lines currently visible in the Log Viewer. |
16 | FIRST | Display the first (oldest) record from the archive file. Equivalent to the |< button on the Log Viewer. |
17 | LAST | Display the last (newest) record from the archive file. Equivalent to the >| button on the Log Viewer. |
20 | EXECUTE | Trigger a request to the archives to refresh the log viewer in order to apply the filter set up par various calls with filtering modes such as MINMAX, EVENTMASK... |
27 | AUTOREFRESH_PAUSE | Pause the auto-refresh mechanism. |
28 | AUTOREFRESH_RESUME | Resume the auto-refresh mechanism. |
31 | GETLINECOUNT | Return the number of lines in the Log Viewer. |
36 | AUTOREFRESH_STATUS |
Return the status of the auto-refresh mechanism. 1 = Running 2 = Paused 3 = Not set (period is 0) |
37 | AUTOREFRESH_PERIOD | Return the auto-refresh period in seconds. |
39 |
UNSELECTALL |
Deselects all lines of the display. |
Return: 1 if OK, else 0 (window cannot be found etc.). Except for modes 31, 36 & 37. |
The maximum number of lines for a Log Viewer is 32,000.
Syntax 2
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, Argument[, DelayExecution]);
Return type: INTEGER.
Argument | Meaning |
Argument | The name of the new domain, nature or log list. To specify all the domains and natures, Argument must be a null string. Type STR. |
Execution
Selects the new domain, nature or log list.
Mode | Mnemonic | Action |
9 | DOMAIN | New domain. |
10 | NATURE | New nature. |
21 | LOGLIST | New log list. |
Return: 1 if OK, else 0. |
If the filter animation of the Log Viewer is configured with domain and/or nature, the FILTER mode of LOGDISPLAY will be ignored.
Syntax 3
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, StartTime [ ,EndTime[, DelayExecution]]);
Return type: INTEGER.
Argument | Meaning |
StartTime |
The new start time for the Log Viewer, expressed as the number of milliseconds since 1980. See the instruction DATETIMEVALUE. Type DOUBLE. If omitted then the current time is used. |
EndTime |
The new end time for the Log Viewer, expressed as the number of milliseconds since 1980. See the instruction DATETIMEVALUE. Type DOUBLE. If omitted then the current time is used. |
Execution
Mode | Mnemonic | Action |
12 | SETDATETIME | Selects a new time for the Log Viewer Return: 1 if successful, else 0. |
Syntax 4
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, Filter[, DelayExecution]);
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 |
13 | FILTER |
Defines information to be displayed in the log viewer by applying a filter expression.
Return: 1 if successful, else 0 (window cannot be found...). |
If the filter of the log list has been configured with a domain or nature, the LOGDISPLAY mode FILTER will not be taken into account.
If the filter is on #T and the log list is in a database archive unit, you must include the column Description in the log table otherwise the result is an empty viewer.
The supported filter criteria are described in the topic Using a Sql expression to filter variables in the HMI book.
The Filter string is used as a Where clause. Essentially, operators and syntax elements supported by the RDBMS can be used, including the square bracket notation for the filter criteria (table columns).
For example, [TextAttr11] IS NOT NULL
Syntax 5
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, Min, Max[, DelayExecution]);
Return type: INTEGER.
Argument | Meaning |
Min | The minimum priority level of alarms. Type INTEGER. |
Max | The maximum priority level of alarms. Type INTEGER. |
Execution
Mode | Mnemonic | Action |
19 | MINMAX | Selects information displayed in the log window by applying
a minimum and maximum priority level for alarms. Return: 1 if successful, else 0 |
Syntax 6
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, EventMask[, DelayExecution]);
Return type: INTEGER.
Argument | Meaning |
EventMask | A mask of events. See the topic Event masks for more information on how masks are constructed. Type DOUBLE. |
Execution
Mode | Mnemonic | Action |
18 | EVENTMASK | Change the mask of events. Return: 1 if successful, else 0. |
When used with WebVue both Logon and Logoff events are retrieved when filtering using EVENTMASK or EVENTMASKEX.
Syntax 7
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, StartTime[, EndTime[, DelayExecution[, ChangeNoOfLines]]]);
Return type: INTEGER.
Argument | Meaning |
StartTime |
The new start time for the Log Viewer, expressed as the number of milliseconds since 1980. See the instruction DateTimeValue. Type DOUBLE. If omitted then the current time is used. |
EndTime |
The new end time for the Log Viewer, expressed as the number of milliseconds since 1980. See the instruction DateTimeValue. Type DOUBLE. If omitted then the current time is used. |
ChangeNoOfLines | An optional flag that causes a temporary change in the size of the Log Viewer buffer. See below. |
Execution
Mode | Mnemonic | Action |
12 | SETDATETIME | Selects a new time for the Log Viewer Return: 1 if successful, else 0. |
Changing the number of lines
If the number of lines arising from the request is more than the configured size of the buffer, and the flag ChangeNoOfLines is set to 1 the Log Display buffer sizes is temporarily increased to the maximum of 32,000 lines. The display is positioned on first line of the start time.
If you make a further request, other than SETDATETIME with ChangeNoOfLines set to 1, or if you close the Log Viewer animation, the size of the Log Viewer buffer reverts to its original value.
Syntax 8
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity[, PrintFormat]);
Return type: INTEGER.
Argument | Meaning |
PrintFormat |
Optional parameter for selecting the format for printing: |
Execution
Mode | Mnemonic | Action |
11 | PRINTALL | Print the entire contents of the current buffer on the printer configured in the Log Viewer. |
14 | PRINTSELECTED | Print the selected line on the printer configured in the Log Viewer |
15 | PRINTDISPLAY | Print all the lines currently visible in the Log Viewer. |
Return: 1 if OK, else 0 (window cannot be found etc.) |
Syntax 9
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, ProgramModule, ProgramBranch, ProgramFunction, ProgramParameter);
Return type: INTEGER.
Argument | Meaning |
ProgramModule | Module of the program to be executed. |
ProgramBranch | Branch for the program. |
ProgramFunction | Function of the program to be executed. |
ProgramParameter | Parameter for the program. |
Execution
Mode | Mnemonic | Action |
23 | LINESELECT | Specifies a program to be executed when a line select/unselect occurs. Return: 1 if successful, else 0. |
The XMLPATH instruction is used to get information about the LINESELECT mode. A namespace is created automatically using Branch, Window and Identity parameters.
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 10
IntVal = LOGDISPLAY(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 |
24 | SETSORT |
Dynamically sort a log list by a column. Return: 1 if successful, else 0 (incorrect parameter...). |
Syntax 11
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, Column);
Return type: INTEGER.
Argument | Meaning |
Column | Values 0 to 7 to identify the column, -1 to reset the sort. |
Execution
Mode | Mnemonic | Action |
25 | 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 GETSORT mode. A namespace is created automatically using Branch, Window and Identity parameters.
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 12
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, lLowPart, lHighPart[, DelayExecution] );
Return type: INTEGER.
Argument | Meaning |
lLowPart | Lower part of the mask. See the topic Event masks for more information on how masks are constructed. Type LONG. |
lHighPart | Upper part of the mask. See the topic Event masks for more information on how masks are constructed. Type LONG. |
Context | An optional flag. If set to 1 the action required by the instruction is delayed until the next EXECUTE mode instruction is used. |
Execution
Mode | Mnemonic | Action |
22 | EVENTMASKEX | Change the events filter of the log viewer. Return: 1 if successful, else 0 (incorrect parameter...). |
When used with WebVue both Logon and Logoff events are retrieved when filtering using EVENTMASK or EVENTMASKEX.
Syntax 13
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, Line);
Return type: INTEGER.
Argument | Meaning |
Line | A 1 based line number. Type INTEGER. |
Execution
Mode | Mnemonic | Action |
29 | ISLINESELECTED | Checks if the line is selected. Return: 1 if selected, else 0 |
30 | ISLINEVISIBLE | Checks if the line is visible. Return: 1 if visible, else 0 |
Syntax 14
IntVal = LOGDISPLAY(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 |
32 | COPY_CLIPBOARD | Copy the selected lines to the Windows clipboard. Return: 1 if successful, else 0 |
Syntax 15
StrVal = LOGDISPLAY(Mode, Window, Branch, Identity, LineStart[, LineEnd, ColSeparator, LineSeparator]);
Return type: STR.
Argument | Meaning |
Linestart | The 1 based numeric ID of a line in the Log Viewer buffer. Type INTEGER. |
LineEnd | The 1 based numeric ID of a line in the Log 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 |
33 | GETLINES | Return the lines from LineStart to LineEnd (inclusive) as a single string delimited using the ColSeperator and LineSeperator characters. If LineEnd is omitted only a single line is returned with the columns delimited using the default characters. Return: Requested lines of the Alarm Viewer. |
34 | GETSELECTEDLINES | Same as GETLINES except that only selected lines are returned. |
Return an empty string in case of error. |
Syntax 16
StrVal = LOGDISPLAY(Mode, Window, Branch, Identity, Line, Column);
Return type: STR.
Argument | Meaning |
Line | The 1 based numeric ID of a line in the Log Viewer buffer. Type INTEGER. |
Column | The 1 based numeric ID of a column in the Log Viewer buffer. Type INTEGER. |
Execution
Mode | Mnemonic | Action |
35 | GETCELL |
Return the contents of the specified cell or an empty string in case of error. |
Syntax 17
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, AutoRefreshPeriod, PauseWhenNavigating );
Return type: INTEGER.
Argument | Meaning |
AutoRefreshPeriod | The auto refresh period in seconds. If executed in a WebVue session context, the value cannot be less than 5 seconds. Type INTEGER. |
PauseWhenNavigating |
A flag indicating if the Log Viewer refresh should be paused whilst using the navigation buttons. 0 = Do not pause, 1 = pause. Type INTEGER. |
Execution
Mode | Mnemonic | Action |
26 | AUTOREFRESH_SET |
Set the auto-refresh period and action whilst navigating. Return: 1 if successful, else 0. |
Syntax 18
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, LineNumber);
Return type: STR.
Argument |
Meaning |
LineNumber |
Position of the line in the log viewer, starts at 1. |
Execution
Mode |
Mnemonic |
Action |
38 |
GET_NAME_FROM_LINE |
Return the element name for the given line or an empty string in case of error. |
Syntax 19
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, Column, Width);
Return type: INTEGER.
Argument | Meaning |
Column | 1 based numeric index of a column in the Log Viewer. Type INTEGER. |
Width | Column width in pixels. Range 0 to 3000. Type INTEGER. |
Execution
Mode | Mnemonic | Action |
40 | SETCOLUMNWIDTH |
Set the width of the specified column in pixels. |
Syntax 20
IntVal = LOGDISPLAY(Mode, Window, Branch, Identity, Column);
Return type: INTEGER.
Argument | Meaning |
Column | 1 based numeric index of a column in the Log Viewer. Type INTEGER. |
Execution
Mode | Mnemonic | Action |
41 | GETCOLUMNWIDTH |
Get the width of the specified column in pixels. |
Example
For examples, select the Example link above.