Overview Project settings Statistics

The statistics function records any variables over long periods of time and displays them as a chart. The recording runs in the controller and is independent of whether the Studio is connected. The data is stored in a database on the controller's storage medium (pt2020_statistic.db) and is therefore retained after a restart. Please observe the notes at the end of this article.

Call: menu Project settings - Statistics

This window is used both to define what is recorded and to load and display the data that has already been recorded.


Layout of the window

Area Meaning
Toolbar Top edge of the window. Contains the buttons for loading, exporting and deleting the data as well as the setting for the maximum number of records.
Tabs (groups) Left area. The variables to be recorded can be split into several groups, each group has its own tab with its own table.
Table of variables List of the variables of the selected group with name, address and line colour.
Chart Right area. Shows the loaded data of the currently selected group. The separator between table and chart can be moved with the mouse.


Procedure

  1. Open the window via Project settings - Statistics. The variables window is displayed automatically.
  2. If required, create a group with the + button at the top right of the tabs. If no group exists yet, one must be created first.
  3. Drag variables from the variables window into the table with the mouse. Several variables can be dragged at the same time. The comment of the address is adopted as the name.
  4. Double-click a variable (or context menu Properties) and set up the recording, above all Trigger and Time type.
  5. The context menu entry Automatic colours assigns a different line colour to every variable of the group.
  6. Set Max. data sets recording to match the desired recording period.
  7. Use Apply to send the settings to the controller. The recording is restarted immediately with the new settings.
  8. Later use Load data to fetch the desired period from the controller and evaluate it in the chart.

Important: The Ok button only stores the settings in the project, they are not sent to the controller. To make the controller record with the changed settings, use Apply or transfer the project to the controller. Cancel discards all changes made in the window.


Toolbar

Button Function
Export Opens the data table of the variable selected in the table (see Data and export). The button is only active when a variable is selected and only shows previously loaded data.
Load data Loads recorded data from the controller. A menu for selecting the period opens (see Load data). An existing connection to the controller is required.
Delete all recordings After a confirmation prompt, deletes all recorded data in the controller. The settings of the variables are retained. The operation cannot be undone.
Help Opens this help page (F1 key).
Max. data sets recording Maximum number of records in the database of the controller, range 1,000 to 99,999,999. If this number is exceeded, the oldest records are deleted. The limit applies to the whole recording, not to each variable. The approximate memory requirement is displayed next to it, calculated with about 194 bytes per record.

If a connection exists, the title bar of the window shows the actual number of recorded data sets and the size of the database. The values are requested when the window is opened.


Groups (tabs)

The variables can be split into several groups, for example temperatures, energy and shading. The chart always shows only the variables of the currently selected tab. The recording itself always covers all variables of all groups.

Operation Function
+ (top right) Creates a new group. The name is requested and can be chosen freely. A maximum of 32 groups is possible.
- (top right) After a confirmation prompt, deletes the selected group together with the variables it contains.
Move Context menu of the table. Moves all selected variables to another group. The entry is only available if more than one group exists.


Table of variables

Operation Function
Add variables Drag variables from the variables window into the table. The + button below the table or the context menu entry Add address displays the variables window for this purpose. A maximum of 1,024 variables is possible.
Delete variables - button below the table or context menu Delete address. All selected variables are removed. The data already recorded for these addresses is retained in the controller.
Check mark in front of the name Only controls whether the variable is displayed in the chart. All variables of the table are always recorded. The display can therefore be changed at any time without losing data.
Line column Shows the line colour. A double-click on this column opens the colour selection directly.
Double-click A double-click on any other column opens the properties of the selected variables.
Single click Selects the corresponding address in the variables window. A click on the check mark immediately shows or hides the line in the chart.
Context menu (right mouse button) Contains the entries Properties, Data, Automatic colours (assigns a different colour to every variable of the group), Move, Add address and Delete address.


Properties of a variable

The dialog is opened by double-clicking the variable or via the context menu Properties. If several variables are selected, the settings are applied to all selected variables. The values of the first selected variable are displayed; the name is only applied to this one variable, all other parameters apply to all selected variables.

Parameter Description
Name Any name, used in the table and in the chart. When a variable is added, the comment of the address is adopted.
Only write commands Only telegrams with a write command are recorded. Without this option, answers to read requests (responses) are recorded as well. The option is switched on by default.
Line colour Colour of the line in the chart. The button opens the colour selection.
Line thickness Thickness of the line in the chart, range 1 to 255. The dot size of the individual measured values also depends on this value.
Line type
  • Linear: The data points are connected by a straight line, this is intended for recording analog values.
  • Rectangle: The value is held until the next data point, this is intended for recording bit values.
When a variable is added, the type is selected automatically: addresses of type EIS 1 get Rectangle, all others Linear.
Minimum / Maximum Limit for the display. Faulty outliers that would otherwise make the scaling of the chart useless can be limited with this. This setting has no effect on the recording. If minimum and maximum are equal, the limitation is not active.
Factor The recorded value is multiplied by this factor for the display, for example 0.001 to show watts as kilowatts. The value 0 is ignored, in this case no multiplication takes place. The default is 1. The recording itself is not changed.
Offset This value is added after the factor for the display. It can be used to compensate a zero point shift, for example. The recording itself is not changed.
Trigger Defines when a value is recorded, see trigger in detail.
  • Telegram: Recording on every telegram.
  • Change: Recording when the value changes.
  • Time: Cyclic recording at the configured point in time.
  • Time+change: Cyclic recording at the configured point in time, but only if the value has changed.
Difference Only visible with trigger Change and Time+change. The value is only recorded once it has changed by at least this amount compared to the last recorded value. With 0 every change is recorded. A sensible difference, for example 0.5 for a temperature, reduces the amount of data considerably.
Time type Only visible with trigger Time and Time+change. Defines the time interval of the recording:
  • Free: Fixed interval in seconds, see Time seconds.
  • Minute: On every full minute.
  • Hour: On every full hour.
  • Day: On the change of day.
  • Week: On the change of week.
  • Month: On the change of month.
  • Year: On the change of year.
After a restart of the controller the recording starts with the next point in time.
Time seconds Only visible with time type Free. Interval of the recording in seconds, adjustable from 1 to 99 seconds. The value 0 is treated as 60 seconds by the controller.


Trigger in detail

Trigger Behaviour in the controller
Telegram Every telegram on the address is recorded, even if the value has not changed. This setting creates the largest number of records and is mainly intended for diagnostics.
Change On every telegram the new value is compared with the last recorded one. A record is only written if the difference is at least the configured difference. Recommended setting for bit values (EIS 1).
Time Independently of the telegrams, the current value is always recorded at the configured point in time. This produces a continuous curve with an even spacing, even if the value does not change for a long time.
Time+change Like Time, but a record is only written if the value has changed by at least the configured difference since the last recording. This setting is the best compromise between meaningful data and data volume and is preset automatically together with the time type Minute when an analog variable is added.


Load data

The Load data button fetches the recorded data from the controller. An existing connection is required; if the controller is not connected, a message is displayed. All recorded addresses of the selected period are always loaded, displayed are the variables of the currently selected group.

Selection Period
1 / 6 / 12 / 24 hours The last 1, 6, 12 or 24 hours from the current point in time.
Day The current day from 00:00 to 23:59.
Week The current week from Monday to Sunday.
Month The current month from the first to the last day.
Year The current year from the first to the last day.
Select date and time Opens a dialog in which the start (From) and the end (To) can be set freely.

The progress is displayed during the transfer, large periods can take some time. Before loading, the current settings of the window are adopted into the project.


Chart

Operation Function
Mouse wheel Zooms the time axis in and out.
Dragging with the mouse Moves the displayed time range. The vertical axis remains unchanged.
Mouse pointer in the chart Shows the value and the point in time of the current mouse position as a tooltip.
Scaling The vertical axis is scaled automatically over all visible lines, with an addition of 20 percent upwards and downwards.

When the group is changed or a check mark in the table is changed, the chart is redrawn immediately. The data does not have to be loaded again for this.


Data and export

The context menu entry Data or the Export button opens the loaded records of the selected variable as a table. If no data is loaded for this variable, a message is displayed.

Column Content
Date / Time Point in time of the recording.
Source Physical address of the sender of the telegram.
Destination Group address of the recorded variable.
Value Recorded value. Factor and offset are not included here, the original value is displayed.
Service ID Service of the controller the telegram originates from.
Command Type of the telegram: READ, RESPONSE or WRITE.

The Export button in this window saves the table as a CSV file. The columns are separated by semicolons.


Notes