Events

Материал из WebHMI Wiki
Версия от 14:31, 9 октября 2017; Evgeniy.mozoliak (обсуждение | вклад) (Новая страница: «As an example of the event report, let's consider the task of determining the time interval when a certain parameter took a given value (1), recording additional…»)

Перейти к: навигация, поиск

Events are a mechanism that allows you to record data only upon specified conditions are met: a certain technological operation has started, or for example, a process parameter has exceeded the allowed limits - and it is necessary to obtain a separate set of data related to this moment, such as the start, end, values ​​or changes of other parameters (affecting the process or dependent on it) at this time, or during this process state, making so possible to effectively analyze such situations.

Thus, the events allow you to conveniently filter out the necessary data for each of these conditions for their occurrence, and obtain separate structured reports for each event separately. Unlike building the necessary protocols by 'mining' information in the database (logs), event reports are generated 'on the fly' ie. at a pace with the monitoring process. After the event is created, its data becomes available as reports in the Configuration - Reports menu, and it is also possible to present data on the timeline ('tape') available in the Reports - Timeline ( Reports / Timeline) (after selecting the Show on timeline option for one of the events).

As an example of the event report, let's consider the task of determining the time interval when a certain parameter took a given value (1), recording additional data associated with this event - start and end time of this interval, the last value of a certain parameter. As the signal source, we will use register data D0 (bit). To create events, select the menu item Configuration / Events , then Add new event. The basic settings are shown in the figure. Because the event is continuing, you must remember to specify the appropriate option. A parent event checkbox means that this event will only be registered if the parent event occurs.
Edit event basic.png

The Condition tab serves for defining event trigger condition:
Condition.png

The visual editor allows you to 'glue' the logical expressions in a chain of conditions, with several levels of nesting if required. The following blocks are available

Logic -logic operators "NOT", "AND", "OR", and comparison - "equal", "not equal", "greater than", "less than", "greater or equal", "less or equal";
Math - arithmetic blocks - a constant, or an operation of addition, subtraction, multiplication, division;
Registers - selection block to include a register in logical or arithmetic expressions;
The event may have different conditions for start and end.
The 'Action ' tab of the event settings determines what, how, and when have to be recorded in the event report data structure.
Action .png

При выборе опции "Добавить регистры в отчет (Save to log)" появится возможность задания регистров условия вида Ey.x.(полное описание см здесь). Регистры условий нумеруются от 0 и далее по возрастанию (х - это индекс), y - идентификатор события, который присваивается ему при создании и отображается в списке событий. В качестве параметра записываемого в регистр условий может быть 4 варианта:
  • Start time - время начала события
  • End time - время окончания события
  • Last update time - время последнего обновления, фактической регистрации события
  • Произвольный регистр из списка объявленных в меню Registers - при этом в третьей колонке настроек отчета можно будет дополнительно выбрать обработку этого регистра -взять минимальное(Min), максимальное значение(Max), первое значение при старте события(First Value) или последнее при его окончании(Last Value), среднее значение (Average Value).
<p>Настройки для регистров условий в и используемом нами примере приведены на предыдущем рисунке. Название столбцов отчета могут изменены. Для регистров E2.0, E2.1, содержащих время, используется строка задания формата, принятая в PHP. Для регистров E2.2, E2.3 заданы мин и макс. значения соответственно.Е2.4 - усредненное значение регистра на протяжеиии события.

Результатом настройки данного события станет появление в меню Reports отчетов такого вида:

Event report example copy.png

Поскольку при создании события была также указана опция "Show on timeline", все события будут сохранены и также и на ленте. Выноской с точкой на оси отмечается начало события, либо однократное событие. Удерживая нажатой основную кнопку мыши, можно сдвинуть график по горизонтали, "прокруткой" колеса мыши изменяется масштаб.

Time line.png