events
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
events [2019/01/15 11:17] – [Viewing recorded Event] emozolyak | events [2022/01/26 14:15] (current) – [Report constructor] emozolyak | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{ network: | ||
====== Events ====== | ====== Events ====== | ||
===== About events ===== | ===== About events ===== | ||
- | Events are a mechanism that allows | + | With events |
- | {{ ::events_application.png? | + | {{ :analytics:events_app_new.png? |
- | The recorded events cab be used in a few ways: | + | Unlike building the necessary protocols by ' |
- | *be viewed using embedded | + | |
- | *exporting event data into csv - file | + | |
- | *transferning event date into any applicaion using API | + | |
- | *using event data in Level2 | + | |
- | *show start / end time of the event on the timeline both in WebHMI and Level2 | + | |
- | Unlike building the necessary protocols by ' | ||
- | Tip: Due to 'on the fly' method of recordig events, WebHMI project restart will cause an event being recorded to | ||
- | " | ||
- | apply changes when the event unlikely to happen. | ||
- | ===== Event Example ===== | ||
- | ==== Creating Event==== | + | |
+ | |||
+ | |||
+ | |||
+ | ===== Customizing an event ===== | ||
+ | ==== Creating | ||
Setup / Events menu is for adding events into a project. | Setup / Events menu is for adding events into a project. | ||
- | {{ :: | + | {{ network:event_menu_location.png? |
- | In out example we want: | + | 'Add event' button is located |
- | *To register when Pump #1 on the sewage pump station runs (__start / stop times__) | + | |
- | *To know were there any __alerts__ | + | |
- | *To know __maximal level__ in the tank | + | |
- | === Event Basic settings === | + | {{ network: |
+ | |||
+ | ==== Event Basic settings | ||
In the Basic tab, there are 3 items: | In the Basic tab, there are 3 items: | ||
Line 40: | Line 35: | ||
***Parent event** This event recorded only if a high-level, or parent event is running now. I.e. this event nests in a parent event with all its data. | ***Parent event** This event recorded only if a high-level, or parent event is running now. I.e. this event nests in a parent event with all its data. | ||
- | {{ :: | + | {{ network:hide_child_event_1.png? |
- | === Event Condition === | + | === About parent and child events === |
+ | If there is some process that could happen " | ||
+ | *They are recorded only when the parent event is being recorded, i.e. parent' | ||
+ | *Parent event' | ||
+ | *Child event table are referenced as a links inside the parent event view table. You can disable child event link visibility for the parant event view - see more on this in Viewing events | ||
+ | *Child event run/stop states can be used as timeline source data or Gant diagram inside the parent event report page | ||
+ | *For child events no report entry will be created in the side menu. | ||
+ | |||
+ | {{ network: | ||
+ | |||
+ | ==== Event Condition | ||
After a 3.3 version, WebHMI has simpler condition setting - if some register' | After a 3.3 version, WebHMI has simpler condition setting - if some register' | ||
- | {{ :: | + | {{ network:new_ev_condition_tab.png? |
Of course, the event conditions sometimes | Of course, the event conditions sometimes | ||
- | {{ :: | + | <code lua> |
+ | -- complex event start condition | ||
+ | local tmr_state, count_down = Timer(var1 > 60, ON_DELAY, OFF_DELAY, " | ||
+ | local eventEnableCondition = var2 and var3 or (var4 and count_down >= 30) | ||
+ | </ | ||
- | The events may have or not have __duration in time__. | + | === Lasting vs. one - shot events === |
- | If you want only to register one point in time when something happens, then the event condition must be true for ONLY one scan. Otherwise the records will be added in every scan while event condtion is true. | + | The events may have or do not have duration in time. For lasting events (that is more common application) |
- | If you want to register | + | For day, week etc. totals |
- | There are respective **chackboxes** named 'Has some duration in time' and 'End condition differs from start condition' | + | ==== Event Actions |
- | + | ||
- | === Event Actions === | + | |
The ' | The ' | ||
+ | {{ network: | ||
- | {{ :: | + | |
- | + | ||
- | ***Title** - The title field for the Setup menu. Possible to re-type here | + | |
- | | + | |
***Report title** - It is the Report title when it's viewed or accessed from API, etc. | ***Report title** - It is the Report title when it's viewed or accessed from API, etc. | ||
***Menu item name** It is how the ' | ***Menu item name** It is how the ' | ||
- | ***Save data** | + | ***Save data** |
+ | *__Once per Event__ | ||
+ | *__Every X seconds__ . All data will be saved at regular interval, i.e. there will be multiple records with their respective timestamps. This option is used when you want to build a graph based on the event data in [[level2: | ||
- | == Selecting | + | === Selecting |
- | If you press **+Add Register to report**, the following dialog will appear: | + | Besides a common register selection list, there are 3 extra values in the list: |
+ | | ||
+ | | ||
+ | | ||
+ | {{ network:register_selector_with_white_bgnd.png? | ||
- | {{ :: | + | *//Register Ey.x// - Thе Ey.x notation can be used to refer this data in the [[webhmi_internal_registers?s[]=internal&s[]=registers# |
+ | *you can select first value or last, maximal, minival, average. | ||
+ | *For the reigsters with time or duration format set, the format field will be promtped as time format (H:i etc.) | ||
- | It is possible to pick up 4 options: | + | |
- | | + | ***Show on timeline** - the checkbox makes the event to be shown in the timeline viewer. |
- | | + | |
- | | + | |
- | *//Any register from Registers list// - when you select a register from your project, then you can re-type | + | |
- | {{ :: | + | |
- | + | ||
- | The rows of selected register have **Register E1.0, 1.1, ... ** string left to it. These E-registers are indexed from 0 and further in ascending order (**x** is an index), **y** is the event identifier that is assigned | + | |
| | ||
- | **Show | + | ===== Viewing events data===== |
+ | |||
+ | When there are configured and logged events in a project, an event viewing page became accessible too: | ||
+ | |||
+ | {{ network: | ||
+ | |||
+ | - Report access menu | ||
+ | - __Refresh__, | ||
+ | - __Calendar__ to pick desired time interval for viewing | ||
+ | - __Search__ omnibox | ||
+ | - __Table header__. The columns names are action titles set in //Actions// tab. There are sort arrows as well. | ||
+ | - This is a row with __unfinished__ event i.e. not having end condition fulfilled and interrupted by a new start event condition. | ||
+ | - __Highlighted__ event | ||
+ | - Row with normal data. | ||
+ | - Link to the __wrapped (daughter, or nested) event__ | ||
+ | - Link to the event __report__, configured in the Report builder. | ||
+ | |||
+ | === Highlighting events === | ||
+ | |||
+ | You can mark some row in the table (having error, alert etc.). There is a ' | ||
+ | |||
+ | {{ network: | ||
+ | Then the rows will be highlighted like #7 in the list above. | ||
+ | |||
+ | === Calculating column totals === | ||
+ | |||
+ | For the columns of the event view table, you can add totals in the table' | ||
+ | {{ network: | ||
+ | |||
+ | {{ network: | ||
+ | |||
+ | === Setting up permissions === | ||
+ | |||
+ | You can set permission for the users who may access event view table. | ||
+ | {{ network: | ||
+ | |||
+ | ===== Report constructor ===== | ||
+ | |||
+ | There is a report constructor similar to the [[screens? | ||
+ | |||
+ | {{ network: | ||
+ | Like in screen editor, you pick widgets and arrange them on the canvas. | ||
+ | {{ network: | ||
+ | |||
+ | Below notes on the widgets for the report constructor are given: | ||
+ | |||
+ | == Graph widget == | ||
+ | |||
+ | The graph widget is drawn based on the graph __already existing__ in the project. You just pick one of the graph from a list: | ||
+ | {{ network: | ||
+ | For the time range, event start / end times are used. | ||
+ | |||
+ | == Gannt widget == | ||
+ | It's similar to that of the screen widget. You can select only child event as data source for the diagram. | ||
+ | {{ :: | ||
+ | |||
+ | The summary shows duration of all events: | ||
+ | {{ : | ||
+ | |||
+ | <WRAP center round download 80%> | ||
+ | Please refer to the demo project {{ : | ||
+ | Rename the file to .bak after download. | ||
+ | </ | ||
+ | |||
+ | |||
+ | == Register value == | ||
+ | |||
+ | Register value widget is similar to that in the screen editor, except for register selection: you can only pick up one of the event' | ||
+ | |||
+ | {{ network: | ||
+ | |||
+ | You can add options to add text label, change font size for both value text and text label, display measurement units and scale: | ||
+ | |||
+ | {{ network: | ||
+ | |||
+ | For a scale, you set start, end point and its color: | ||
+ | {{ network: | ||
+ | |||
+ | If you want the value be centered with the scale, choose __windows centered__ option in the Appearance tab: | ||
+ | |||
+ | {{ network: | ||
+ | |||
+ | Please note that in the edit mode the value is refered to as " | ||
+ | {{ network: | ||
+ | |||
+ | == Values table == | ||
+ | Values table widget is identical to that one in the screen editor except for register selector (only from event' | ||
+ | |||
+ | {{ network: | ||
+ | |||
+ | == Bar char, hystogram, pie chart == | ||
+ | |||
+ | These are identical to the screen editor widgets, except for the register selector. | ||
+ | |||
+ | == Text widget == | ||
+ | It is simple html editor, please refer to the video below. For the actions - you can type action address in the form of Ey.x or use action picker. | ||
+ | |||
+ | {{network: | ||
+ | |||
+ | |||
+ | |||
+ | ===== Other event usage options ===== | ||
+ | |||
+ | Besides above application, | ||
+ | |||
+ | === Get event data from external applicaion via API === | ||
+ | |||
+ | More on this - [[access_via_api# | ||
+ | |||
+ | === Send event data to Level2 === | ||
+ | There is a report builder in the Level2 system as well which uses data taken from WebHMI as a source. More on this [[level2: | ||
+ | |||
+ | === Creating a timeline based on time from the event === | ||
+ | |||
+ | When you set __Show on timeline__ | ||
+ | {{ network: | ||
+ | |||
+ | === Advanced customized reports based on events, screens, lua and api === | ||
+ | |||
+ | The Report constructor for events may not be convinient in some cases: | ||
+ | *the processes last long time (days, weeks, monthes, years etc) and event logging may be interrupted by some maintenacne or other occastions which is not acceptable (this will split the event) | ||
+ | *you need to generate report which unites data from many different events, so you can not use event' | ||
+ | *the system consist of many logical units which would require to make a lot of duplicating reports | ||
+ | |||
+ | In this cases, still a desired report can be obtained from particular events, lua, api and screen/ | ||
+ | You can use the following approach: | ||
+ | *use screen/ | ||
+ | *use lua script which would make api call to webhmi' | ||
+ | *use javascript to change screen widget properites - start / end time for graph, changing parameters etc. | ||
+ | |||
+ | <WRAP center round info 80%> | ||
+ | Please refer to the following application [[events_in_machine_monitoring | note]]. | ||
+ | </ | ||
+ | |||
+ | ===== Notes on event usage ===== | ||
+ | |||
+ | === Editing events in the running project === | ||
+ | |||
+ | <WRAP center round important 80%> | ||
+ | Due to 'on the fly' method of recordig events, WebHMI project restart will cause an event being recorded to | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | === One - time events === | ||
+ | |||
+ | <WRAP center round tip 80%> | ||
+ | With one-time event, i.e. those not having 'event has duration' | ||
+ | </ | ||
- | **Add log message** - If you select this checkbox, | + | The script which gives a right condtion for an one-shot |
- | ==== Viewing recorded Event==== | + | <code lua> |
+ | function main (userId) | ||
+ | -- vars | ||
+ | local prev_cur_hour | ||
+ | local cur_hour | ||
+ | -- logic | ||
+ | if (cur_hour ~= prev_cur_hour) then | ||
+ | | ||
+ | | ||
+ | else | ||
+ | | ||
+ | end | ||
+ | end | ||
+ | </ | ||
- | The side bar **Reports** menu is for accessing logged event (it's only available if there are event configured in the project). When viewing the event data you can use __calendar, search box, sorting | + | === Lasting events with different start and end condition === |
- | {{ :: | + | |
- | Since the "Show on timeline" | + | Be carefull with different start and end condition for lasting events. Becuase |
- | {{ :: | + | |
events.1547551030.txt.gz · Last modified: 2019/01/15 11:17 by emozolyak