Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:sw:01-mervis:storing-data-to-history-log-hidden [2020/05/21 13:27]
jan_kozak
en:sw:01-mervis:storing-data-to-history-log-hidden [2021/08/05 14:50] (current)
avsetula
Line 1: Line 1:
 ====== Storing data into a history log ====== ====== Storing data into a history log ======
-This guide will demonstrate how to use history logs for short-term, memory-constrained data storage from Unipi controllers using the Mervis IDE. +<WRAP group> 
 +<WRAP half column 81%> 
 +This guide will demonstrate how to use history logs for short-term, memory-constrained data storage from Unipi controllers using the Mervis IDE. 
 +</​WRAP>​ 
 +<WRAP half column 15%> 
 +;;# 
 +<​html><​span class="​dev-tag dev-patron">​Patron</​span></​html>​ \\ 
 +<​html><​span class="​dev-tag dev-neuron">​Neuron</​span></​html>​ \\ 
 +<​html><​span class="​dev-tag dev-gate">​Gate</​span></​html>​ \\ 
 +<​html><​span class="​dev-tag dev-unipi11">​Unipi&​nbsp1.1</​span></​html>​ \\ 
 +<​html><​span class="​dev-tag dev-axon">​Axon</​span></​html>​ 
 +;;# 
 +</​WRAP>​ 
 +</​WRAP>​
  
 <WRAP center round box> <WRAP center round box>
 <​html><​span class="​kbBlue-H4alt">​Prerequisites:</​span></​html>​ <​html><​span class="​kbBlue-H4alt">​Prerequisites:</​span></​html>​
   - Unipi controller running the Mervis OS   - Unipi controller running the Mervis OS
-  - 24V power supply+  - 24 V⎓ power supply
  
 {{ :​files:​img_breakline_2.png?​nolink |}} {{ :​files:​img_breakline_2.png?​nolink |}}
Line 20: Line 33:
 {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-01-workspace.png?​direct |}} {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-01-workspace.png?​direct |}}
  
-Start by selecting the PLC in the **left panel**. In the **Properties** menu, you need to change **Runtime ID for History** attribute, which is used as identification of the PLC's history. If the PLC will be connected to the Mervis DB service the identification will be also used in the Mervis DB viewer visualisation tool. Enter a descriptive name, such as the PLC's location or its function.+<​html><​div class="​directTag"​ id="​runtime-set"></​div></​html>​ 
 +Start by selecting the PLC in the **left panel**. In the **Properties** menu, you need to change **History ​Runtime Identification** attribute, which is used as identification of the PLC's history. If the PLC will be connected to the Mervis DB service the identification will be also used in the Mervis DB viewer visualisation tool. Enter a descriptive name, such as the PLC's location or its function.
  
 {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-02-mervis-db-parameters.png?​direct |}} {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-02-mervis-db-parameters.png?​direct |}}
  
-The next step is to defined ​**History log** containing variables ​we will want to save. In the **left panel** right-click on **History** and in the context menu choose **Add New History**.  ​+The next step is to define a **History log** containing ​all variables ​saved in the history. In the **left panel** right-click on **History** and in the context menu choose **Add New History**.  ​
  
 {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-05-add-new-history.png?​direct |}} {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-05-add-new-history.png?​direct |}}
Line 32: Line 46:
 {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-06-history-properties.png?​direct |}} {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-06-history-properties.png?​direct |}}
  
-Change ​**History log** properties to the following: ​+<​html><​span class="​kbBlueText">​Change History log properties to the following:</​span></​html>​
   * **History saved on PLC**: set to ''​true''​ to enable data logging.   * **History saved on PLC**: set to ''​true''​ to enable data logging.
-  * **Type**: set to ''​Synchronous'' ​FIXME Typ nemusi byt pouze synchronni ale i asynchronni. Tj zminitze ukladat jde i urcite udalosti +  * **Type**: set to ''​Synchronous'', ​for logging in intervals ​ 
-  * **Save Period**: determines the save period for variables included in the History log.   +  * **Save Period**: determines the save period for variables included in the History log. 
-  *  + 
-**History log** is now defined and we can add variables into it. On the **main panel** you should see the main workspace. Simply right-click on ''​office_Temperature''​ global variables and in the context menu click on **Add to History**. Using a similar method you can add variables into history also from the **Variable browser**.+<​html><​span class="​kbBlueText">​Alternatively,​ you can enable event-based logging:</​span></​html>​ 
 +  * **Type**:''​Asynchronous''​ enables logging based on an event triggered by a selected variable 
 + 
 +**History log** is now defined and we can add variables into it. On the **main panel** you should see the main workspace. Simply right-click on ''​office_Temperature''​ global variables and in the context menu click on **Add to History**.
  
 {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-07-add-to-history.png?​direct |}} {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-07-add-to-history.png?​direct |}}
 +
 +Using a similar method you can add variables into history also from the **Variable browser**.
 +
 +{{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-07b-add-to-history.png?​direct |}}
  
 **Add to history** window will appear. Choose the correct history log and confirm by clicking on **OK**. ​ **Add to history** window will appear. Choose the correct history log and confirm by clicking on **OK**. ​
Line 49: Line 70:
 {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-09-history-list.png?​direct |}} {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-09-history-list.png?​direct |}}
  
-**Deploy Solution**. The PLC is now ready to store variable history locally. You can check the history log's configuration and other related info in the **Output** tab in the bottom panel. ​In-text logs located here to look for ''​history statistics''​. ​+**Deploy Solution**. The PLC is now ready to store variable history locally. You can check the history log's configuration and other related info in the **Output** tab in the bottom panel after clicking on the Deploy solutionHere in the text logs look for ''​history statistics''​. ​
  
-FIXME Zminit cim a jak je ovlivnen max casovy usek dat ulozenych na PLC (interval ukladanipocet typ promennych)Pro pouziti v offline modu je tohle strasne dulezity, aby si to odladili specificky podle aplikace.+<WRAP center round tip 95%> 
 +This statistic also displays the period for which the history log will be stored in the PLC before being overwritten by new logs. The value is influenced by logging intervals and the number and data type of logged variables. To maximize the storage period we recommend optimizing these parameters. If you wantfor example, to log an outdoor temperature value, most applications should be able to make away with 1-hour intervalAnother option is to create a program (block) that compares temperature values to the most current logged ones, and triggers logging in asynchronous mode when the difference is greater than 1°C 
 +</​WRAP>​
  
 {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-10.png?​direct |}} {{ :​en:​sw:​01-mervis:​storing-data-to-mervis-db-10.png?​direct |}}
Line 57: Line 80:
  
 ===== Related tutorials ===== ===== Related tutorials =====
-  * [[en:​sw:​01-mervis:​multiple-history-intervals-hidden|Multiple history save periods]] +  * [[multiple-history-intervals-hidden|]] 
-  * [[en:​sw:​01-mervis:​download-history-log-hidden|Downloading history logs from a PLC]] +  * [[download-history-log-hidden|]] 
-  * [[en:​sw:​01-mervis:​storing-data-to-mervis-db-hidden|Storing data into Mervis DB]]+  * [[storing-data-to-mervis-db-hidden|]]