<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://daq00.triumf.ca/MidasWiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gerritzen</id>
	<title>MidasWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://daq00.triumf.ca/MidasWiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gerritzen"/>
	<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/MidasWiki/index.php/Special:Contributions/Gerritzen"/>
	<updated>2026-05-06T03:47:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://daq00.triumf.ca/MidasWiki/index.php?title=Equipment_Flags&amp;diff=2875</id>
		<title>Equipment Flags</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/MidasWiki/index.php?title=Equipment_Flags&amp;diff=2875"/>
		<updated>2019-07-16T09:13:46Z</updated>

		<summary type="html">&lt;p&gt;Gerritzen: /* EQ_PERIODIC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Pagelinks}}&lt;br /&gt;
&lt;br /&gt;
==== Links ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* [[Equipment List Parameters]]&lt;br /&gt;
* [[Equipment List Parameters#Type|Equipment Type]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;div id=&amp;quot;Equipment Type&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
==Equipment Flags==&lt;br /&gt;
The following equipment flags (of the form EQ_xxx, defined in [http://ladd00.triumf.ca/~daqweb/doc/midas-devel/doc/html/midas_8h.html midas.h]) are supported in the Equipment [[Equipment List Parameters#Type|Type]] field in the EQUIPMENT structure of a frontend.&lt;br /&gt;
The selected flag determines the Equipment Type.&lt;br /&gt;
&lt;br /&gt;
===EQ_PERIODIC ===&lt;br /&gt;
; Periodic Event [[#Equipment Flags|Equipment Type]]&lt;br /&gt;
: In this equipment Type, no hardware requirement is necessary to trigger the readout function.  Instead, the [[Equipment List Parameters#Readout Routine|readout routine]] associated with this equipment is called periodically. The [[Equipment List Parameters#Period|Period]] field in the equipment declaration is used in this case to specify the time interval between calls to the readout function.&lt;br /&gt;
&lt;br /&gt;
===EQ_POLLED===&lt;br /&gt;
;Polling Event  [[#Equipment Flags|Equipment Type]]&lt;br /&gt;
: In this equipment Type,  the name of the routine polling on a trigger source is &amp;quot;poll_event()&amp;quot;. This routine must be provided in the [[Frontend user code]] by the user. As polling consists of checking a variable for a TRUE condition, if the loop count is infinite and the condition never becomes TRUE, the frontend would not be able to respond to any network commands. Therefore the loop count is determined when the frontend starts for the first time so that it returns after a given time-out if no event is available.  This time-out is usually of the order of 500 milliseconds. The EQ_POLLED equipment type is mainly used for data acquisition based on a hardware condition becoming TRUE, at which time the [[Equipment List Parameters#Readout Routine|readout routine]] associated with the equipment is called. See  [[Frontend user code#Function poll_event| example]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===EQ_INTERRUPT===&lt;br /&gt;
; Interrupt Event [[#Equipment Flags|Equipment Type]]&lt;br /&gt;
: This flag is similar to the [[#EQ_POLLED|EQ_POLLED]] mode, except a hardware interrupt is used to trigger the event rather than a polling loop.  Instead of passing a pointer to the polling routine, in EQ_INTERRUPT mode a pointer to the &#039;&#039;&#039;interrupt configuration routine&#039;&#039;&#039; is passed to the system.  Midas requires complete configuration and control of the interrupt source. This is provided by the interrupt configuration routine (called [[Frontend user code#Function interrupt_configure|interrupt_configure()]]) that must be provided in the [[Frontend user code|Frontend code]] by the user. When a valid interrupt is received, the [[Frontend user code#Event Readout routine|readout routine]] associated with the equipment is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EQ_MULTITHREAD ===&lt;br /&gt;
;Multithread Event Readout [[#Equipment Flags|Equipment Type]]&lt;br /&gt;
:This flag implements the multi-threading capability within the frontend code. The polling is performed within a separate thread and uses the &amp;quot;Midas Ring Buffer Functions&amp;quot; (rb_xxx in [http://ladd00.triumf.ca/~daqweb/doc/midas-devel/doc/html/midas_8c.html midas.c]) for inter-thread communication. EQ_MULTITHREAD is similar to [[#EQ_POLLED |EQ_POLLED]] mode, except for the polling function which in the case of EQ_MULTITHREAD resides in a separate thread. This new type has been added to take advantage of the multi-core processor to free up CPU for tasks other than polling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EQ_SLOW===&lt;br /&gt;
; Slow Control Event [[#Equipment Flags|Equipment Type]]&lt;br /&gt;
: This flag declares the equipment as a Slow Control Equipment (see [[Slow Control System]]). This will enable the call to the &#039;&#039;&#039;idle&#039;&#039;&#039; function part of the class driver. This flag also causes event data to be sent automatically to the &amp;lt;span style=&amp;quot;color: purple; font-style:italic;&amp;quot;&amp;gt;/equipment/variables/&amp;lt;/span&amp;gt; ODB subtree.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===EQ_MANUAL_TRIG===&lt;br /&gt;
; Manual triggered event [[#Equipment Flags|Equipment Type]]&lt;br /&gt;
: This flag enables the equipment to be  [[Frontend user code#Manual Trigger|triggered]] by a remote procedure call (RPC). If EQ_MANUAL_TRIGGER is selected, the web interface will provide an extra button to trigger the equipment. The event may also be triggered by a client via RPC ([[Frontend user code#Manual Trigger|see example]]).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EQ_EB===&lt;br /&gt;
&lt;br /&gt;
;Event Builder event [[#Equipment Flags|Equipment Type]]&lt;br /&gt;
: This flag identifies the equipment as a &amp;lt;b&amp;gt;fragment event&amp;lt;/b&amp;gt;  and should be ORed with [[#EQ_POLLED|EQ_POLLED]] in order to be identified by the [[Event Builder]]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EQ_FRAGMENTED===&lt;br /&gt;
; Fragmented Event [[#Equipment Flags|Equipment Type]]&lt;br /&gt;
: Flag enabled large events (beyond the Midas configuration limit) to be handled by the system (&#039;&#039;&#039;see WARNING below&#039;&#039;&#039;). This flag required that a valid &#039;&#039;max_event_size_frag&#039;&#039; variable was defined in the user  [[Frontend Operation#Frontend|Frontend]] code. The &#039;&#039;max_event_size variable&#039;&#039; was used as fragment size in this case. This option was meant to be used in experiments where the event  &#039;&#039;&#039;rate&#039;&#039;&#039; was not an issue but the  &#039;&#039;&#039;size&#039;&#039;&#039; of the data needed to be extremely large.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color:mistyrose;&amp;quot;&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;WARNING&#039;&#039;&#039;&lt;br /&gt;
::* This flag is obsolescent (not maintained).  It was added for small memory cpus (e.g VxWorks PPC) to send very large events (beyond the Midas configuration limit) back to the host computer.&lt;br /&gt;
::* With modern large-memory cpus (e.g. VMIC), &#039;&#039;&#039;instead of using this flag, the buffer sizes should be increased to accommodate a large event&#039;&#039;&#039; (see [[Event Buffer]]). &lt;br /&gt;
::* The fragmented event mechanism is &#039;&#039;&#039;not to be confused&#039;&#039;&#039; with &amp;quot;event fragments&amp;quot; used by the [[Event Builder]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Equipment]] [[Category:Event]] [[Category:Frontend]]&lt;/div&gt;</summary>
		<author><name>Gerritzen</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/MidasWiki/index.php?title=/Equipment_ODB_tree&amp;diff=2874</id>
		<title>/Equipment ODB tree</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/MidasWiki/index.php?title=/Equipment_ODB_tree&amp;diff=2874"/>
		<updated>2019-07-16T09:13:21Z</updated>

		<summary type="html">&lt;p&gt;Gerritzen: /* Period */ Added note that units are milliseconds&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Pagelinks}}&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* [[Frontend user code]] &lt;br /&gt;
* [[Event Structure]]&lt;br /&gt;
* [[Equipment List Parameters]]&lt;br /&gt;
* &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Purpose  ==&lt;br /&gt;
The ODB /Equipment tree contains user and system information related to a frontend.  &lt;br /&gt;
&lt;br /&gt;
== Creating the /Equipment tree ==&lt;br /&gt;
An empty /Equipment tree will be created by mlogger.&lt;br /&gt;
&lt;br /&gt;
If an [[ Frontend Operation#Equipments and Events|Equipment]] is defined in [[Frontend user code]], the first time the frontend is run, if that equipment does not exist in the ODB, it&lt;br /&gt;
will be created (using db_create_record) in the ODB as a subtree  under the /Equipment tree  with the values supplied in the [[Frontend user code]]. &lt;br /&gt;
&lt;br /&gt;
== Example of /Equipment tree ==&lt;br /&gt;
&lt;br /&gt;
The following is an example of the /Equipment tree from an experiment obtained with the [[odbedit|odbedit ls command]] listing all the defined equipments in the experiment :&lt;br /&gt;
&lt;br /&gt;
 [local:pol:S]Settings&amp;gt;ls /Equipment -l&lt;br /&gt;
 Key name                        Type    #Val  Size  Last Opn Mode Value&lt;br /&gt;
 ---------------------------------------------------------------------------&lt;br /&gt;
 POL_ACQ                         DIR&lt;br /&gt;
 Scaler                          DIR&lt;br /&gt;
 Trigger                         DIR&lt;br /&gt;
 VME                             DIR&lt;br /&gt;
 SisPulser                       DIR&lt;br /&gt;
 INFO                            DIR&lt;br /&gt;
 HISTO                           DIR&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is a listing of one of the equipments in the /Equipment tree shown above :&lt;br /&gt;
&lt;br /&gt;
 [local:pol:S]Settings&amp;gt;ls /Equipment/info/ -lr                &lt;br /&gt;
 Key name                        Type    #Val  Size  Last Opn Mode Value&lt;br /&gt;
 ---------------------------------------------------------------------------&lt;br /&gt;
 INFO                            DIR&lt;br /&gt;
    Common                      DIR&lt;br /&gt;
        Event ID                WORD    1     2     9h   0   RWD  3&lt;br /&gt;
        Trigger mask            WORD    1     2     9h   0   RWD  8&lt;br /&gt;
        Buffer                  STRING  1     32    9h   0   RWD  SYSTEM&lt;br /&gt;
        Type                    INT     1     4     9h   0   RWD  1&lt;br /&gt;
        Source                  INT     1     4     9h   0   RWD  0&lt;br /&gt;
        Format                  STRING  1     8     9h   0   RWD  MIDAS&lt;br /&gt;
        Enabled                 BOOL    1     4     9h   0   RWD  y&lt;br /&gt;
        Read on                 INT     1     4     9h   0   RWD  257&lt;br /&gt;
        Period                  INT     1     4     9h   0   RWD  100&lt;br /&gt;
        Event limit             DOUBLE  1     8     9h   0   RWD  0&lt;br /&gt;
        Num subevents           DWORD   1     4     9h   0   RWD  0&lt;br /&gt;
        Log history             INT     1     4     2h   0   RWD  60&lt;br /&gt;
        Frontend host           STRING  1     32    9h   0   RWD  lxpol.triumf.ca&lt;br /&gt;
        Frontend name           STRING  1     32    9h   0   RWD  pol_fevme&lt;br /&gt;
        Frontend file name      STRING  1     256   9h   0   RWD  pol_fevme.cxx&lt;br /&gt;
        Status                  STRING  1     256   9h   0   RWD  pol_fevme@lxpol.triumf.ca&lt;br /&gt;
        Status color            STRING  1     32    9h   0   RWD  #00FF00&lt;br /&gt;
        Hidden                  BOOL    1     4     9h   0   RWD  n&lt;br /&gt;
&amp;lt;div id=&amp;quot;Example Variables subtree&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    Variables                   DIR&lt;br /&gt;
        DBUG                    FLOAT   9     4     2h   0   RWD&lt;br /&gt;
                                        [0]             0&lt;br /&gt;
                                        [1]             101&lt;br /&gt;
                                        [2]             10201&lt;br /&gt;
                                        [3]             10201&lt;br /&gt;
                                        [4]             101&lt;br /&gt;
                                        [5]             2&lt;br /&gt;
                                        [6]             4&lt;br /&gt;
                                        [7]             1&lt;br /&gt;
                                        [8]             1&lt;br /&gt;
&lt;br /&gt;
        CYCL                    FLOAT   15    4     2h   0   RWD&lt;br /&gt;
                                        [0]             1&lt;br /&gt;
                                        [1]             9800&lt;br /&gt;
                                        [2]             98&lt;br /&gt;
                                        [3]             100&lt;br /&gt;
                                        [4]             9&lt;br /&gt;
                                        [5]             98&lt;br /&gt;
                                        [6]             9800&lt;br /&gt;
                                        [7]             9&lt;br /&gt;
                                        [8]             9&lt;br /&gt;
                                        [9]             8.9682&lt;br /&gt;
                                        [10]            8.966&lt;br /&gt;
                                        [11]            0.0504&lt;br /&gt;
                                        [12]            0&lt;br /&gt;
                                        [13]            8.7906&lt;br /&gt;
                                        [14]            0&lt;br /&gt;
        SUMS                    DOUBLE  4     8     2h   0   RWD&lt;br /&gt;
                                        [0]             0&lt;br /&gt;
                                        [1]             50002&lt;br /&gt;
                                        [2]             0&lt;br /&gt;
                                        [3]             0&lt;br /&gt;
&amp;lt;div id=&amp;quot;Example Statistics subtree&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    Statistics                  DIR&lt;br /&gt;
        Events sent             DOUBLE  1     8     8h   0   RWD  176&lt;br /&gt;
        Events per sec.         DOUBLE  1     8     8h   0   RWD  0&lt;br /&gt;
        kBytes per sec.         DOUBLE  1     8     8h   0   RWD  0&lt;br /&gt;
&amp;lt;div id=&amp;quot;Example Settings subtree&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    Settings                    DIR&lt;br /&gt;
        Names DBUG              STRING  12    32    9h   0   RWD  &lt;br /&gt;
                                        [0]             Data still buffered&lt;br /&gt;
                                        [1]             Num SIS LNE events&lt;br /&gt;
                                        [2]             LNE count from SIS&lt;br /&gt;
                                        [3]             LNE preset value&lt;br /&gt;
                                        [4]             number of bins&lt;br /&gt;
                                        [5]             data bytes code&lt;br /&gt;
                                        [6]             num enabled channels&lt;br /&gt;
                                        [7]             discard first bin&lt;br /&gt;
                                        [8]             discard first cycle&lt;br /&gt;
                                        [9]             not used&lt;br /&gt;
                                        [10]            not used&lt;br /&gt;
                                        [11]            not used&lt;br /&gt;
        Names CYCL              STRING  15    32    9h   0   RWD  &lt;br /&gt;
                                        [0]             Scan type code&lt;br /&gt;
                                        [1]             Number good cycles&lt;br /&gt;
                                        [2]             Number supercycles&lt;br /&gt;
                                        [3]             Cycle num within supercycle&lt;br /&gt;
                                        [4]             Sweep number&lt;br /&gt;
                                        [5]             Num cycles skipped&lt;br /&gt;
                                        [6]             Num cycles histogrammed&lt;br /&gt;
                                        [7]             DAC Increment number&lt;br /&gt;
                                        [8]             DAC Set Value (volts)&lt;br /&gt;
                                        [9]             DAC Readback (volts)&lt;br /&gt;
                                        [10]            ADC1 Average&lt;br /&gt;
                                        [11]            ADC2 Average&lt;br /&gt;
                                        [12]            ADC3 Average&lt;br /&gt;
                                        [13]            ADC4 Average&lt;br /&gt;
                                        [14]            spare&lt;br /&gt;
&lt;br /&gt;
        Names SUMS              STRING  4     32    9h   0   RWD  &lt;br /&gt;
                                        [0]             SC Sum ch17&lt;br /&gt;
                                        [1]             SC Sum ch18&lt;br /&gt;
                                        [2]             SC Sum ch19&lt;br /&gt;
                                        [3]             SC Sum ch20&lt;br /&gt;
&lt;br /&gt;
== Keys in the  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;/Equipment&#039;&#039;&amp;lt;/span&amp;gt; ODB tree  ==&lt;br /&gt;
&lt;br /&gt;
===  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;&amp;lt;equipment-name&amp;gt;&#039;&#039;&amp;lt;/span&amp;gt; subtree  ===&lt;br /&gt;
This subtree in the [[#top|/Equipment ODB tree]] The [[#top|/Equipment ODB tree]] &lt;br /&gt;
will be named for an [[Frontend Operation#Equipments and Events|Equipment]] defined in the [[Frontend user code]]. No two subtrees in an experiment can have the same name.   An &amp;lt;equipment-name&amp;gt; subtree will be present for every defined equipment in all the frontend(s) run on the experiment. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;initial values&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
This subtree will be created (if it does not already exist) the first time the defining frontend is run, and the &#039;&#039;&#039;initial values&#039;&#039;&#039; set are defined in the  [[Equipment List Parameters]] in the [[Frontend user code]] that defines this particular equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; that if these parameters are later changed in the ODB, they will &#039;&#039;&#039;not&#039;&#039;&#039; be overwritten by the values in the frontend, if the frontend is restarted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Common&#039;&#039;&amp;lt;/span&amp;gt; subtree  ====&lt;br /&gt;
This subtree in an [[#&amp;lt;equipment-name&amp;gt; subtree|/Equipment/&amp;lt;equipment-name&amp;gt; subtree]] contains the parameters used by the system to process the  [[Frontend Operation#Equipments and Events|Equipment]]. &lt;br /&gt;
&lt;br /&gt;
The initial values of the Common parameters are set when this tree is created (see [[#initial value|initial values]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Event ID&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; WORD&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains the Event ID of this equipment. See &#039;&#039;&#039;[[Equipment List Parameters#EventID|EventID]]&#039;&#039;&#039; for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Trigger mask&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; WORD&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;   See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains the Trigger mask of this equipment.   See &#039;&#039;&#039;[[Equipment List Parameters#TriggerMask|TriggerMask]]&#039;&#039;&#039; for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Buffer&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains the Buffer parameter of this equipment.   See &lt;br /&gt;
&#039;&#039;&#039;[[Equipment List Parameters#Buffer|Buffer]]&#039;&#039;&#039; for details.&lt;br /&gt;
For Events that are to be logged as banks, Buffer is set to &amp;quot;SYSTEM&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Type&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; INT&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains the Type of this equipment.  See &#039;&#039;&#039;[[Equipment List Parameters#Type|Type]]&#039;&#039;&#039; for details.&lt;br /&gt;
The Type is one of the defined &#039;&#039;&#039;Equipment Flags&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Source&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; INT&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains the Interrupt or Event Source of this equipment.   See &#039;&#039;&#039;[[Equipment List Parameters#Source|Source]]&#039;&#039;&#039; for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Format&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains the data format used for generating the event of this equipment. See &#039;&#039;&#039;[[Equipment List Parameters#Format|Format]]&#039;&#039;&#039; for details.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Enabled&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; BOOL&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] indicated whether this equipment is active. See &#039;&#039;&#039;[[Equipment List Parameters#Enabled|Enabled]]&#039;&#039;&#039; for details.&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Read on&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; INT&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] specifies when the read-out of an event occurs or is enabled. It is set to one or a combination of [[ReadOn Flags]].  See &#039;&#039;&#039;[[Equipment List Parameters#ReadOn|Read on]]&#039;&#039;&#039; for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Period&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; INT&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] specifies the time interval or time-out (units are milliseconds). See &#039;&#039;&#039;[[Equipment List Parameters#Period|Period]]&#039;&#039;&#039; for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Event limit&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; DOUBLE&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] specifies the time interval or time-out. See &#039;&#039;&#039;[[Equipment List Parameters#Event limit|Event limit]]&#039;&#039;&#039; for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Num subevents&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; DWORD&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] enables the super-event capability. See &#039;&#039;&#039;[[Equipment List Parameters#Number of subevents|Number of subevents]]&#039;&#039;&#039; for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Log history&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; INT&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; See [[#initial value|initial value]]&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] enables the [[History System]] for this equipment. See &#039;&#039;&#039;[[Equipment List Parameters#Log History|Log History]]&#039;&#039;&#039; for details.&lt;br /&gt;
A value of 0 disables history logging. This parameter also controls how frequently the history events are generated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Frontend host&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains the name of the Frontend host running the [[Frontend user code]] that defines this particular equipment.&lt;br /&gt;
It is filled by the system.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Frontend name&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains the [[Frontend user code#frontend Name|Frontend name]] defined in the [[Frontend user code]] that defines this particular equipment.&lt;br /&gt;
It is filled by the system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Frontend file name&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains the filename of the [[Frontend user code]] that defines this particular equipment.&lt;br /&gt;
It is filled by the system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Status&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains the combination of [[#Frontend name|Frontend name]]  and [[#Frontend host|Frontend host]] Frontend host that define this particular equipment. It is filled by the system and used by the [[Status Page#mhttpd status page]].&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Status color&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  &amp;quot;#00FF00&amp;quot;&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] contains a colour code to be used for the display of this equipment on the  [[Status Page#mhttpd status page]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Hidden&#039;&#039;&amp;lt;/span&amp;gt;  =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; BOOL&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  &amp;quot;n&amp;quot;&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This key in the [[#Common subtree|Common subtree]] if set to &amp;quot;y&amp;quot; will prevent the display of this equipment on the  [[Status Page#mhttpd status page]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Variables&#039;&#039;&amp;lt;/span&amp;gt; subtree ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; DIR&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This is a subtree  in the [[#Top|/Equipment ODB Tree]].&lt;br /&gt;
&lt;br /&gt;
If either&lt;br /&gt;
* the [[#Read on|Read on]] parameter contains the [[ReadOn Flags|RO_ODB flag]] or &lt;br /&gt;
* [[#Log history|Log history]] is non-zero, i.e. History logging is enabled &lt;br /&gt;
the event data will be copied to the ODB and listed in this subtree. &lt;br /&gt;
&lt;br /&gt;
In that case, this subtree will contain array(s) of event data named for the bankname(s) in the readout function (see [[Frontend user code#Event Readout routine]].&lt;br /&gt;
See [[#Example Variables subtree|example]] above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Statistics&#039;&#039;&amp;lt;/span&amp;gt; subtree ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; DIR&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This subtree  in the [[#Top|/Equipment ODB Tree]] contains statistics written by the system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Events sent&#039;&#039;&amp;lt;/span&amp;gt; subtree =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; DOUBLE&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
This key in the  [[#Statistics subtree|Statistics]] subtree  contains the number of events of [[#Event ID|Event ID]] sent. It is filled by the system and used for display on the [[Status Page#mhttpd status page]]. See [[#Example Statistics subtree|example]] above.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Events per sec&#039;&#039;&amp;lt;/span&amp;gt; subtree =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; DOUBLE&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
This key in the  [[#Statistics subtree|Statistics]] subtree  contains the number of events of [[#Event ID|Event ID]] sent per second. It is filled by the system and used for display on the [[Status Page#mhttpd status page]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;kBytes per sec&#039;&#039;&amp;lt;/span&amp;gt; subtree =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; DOUBLE&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
This key in the  [[#Statistics subtree|Statistics]] subtree  contains the number of kBytes per second for events of [[#Event ID|Event ID]] sent. It is filled by the system and used for display on the [[Status Page#mhttpd status page]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Settings&#039;&#039;&amp;lt;/span&amp;gt; subtree ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; DIR&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This subtree  in the [[#Top|/Equipment ODB Tree]] contains user-defined settings, some of which may be used by the system.&lt;br /&gt;
Any values defined in this subtree will appear in [[Event Notification (Hot-Link)#experim_dot_h|experim.h]] files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====  &amp;lt;span  style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;&amp;lt;Names&amp;gt;&#039;&#039;&amp;lt;/span&amp;gt; subtree =====&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING  (ARRAY)&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
These optional key(s) in the  [[#Settings subtree|Settings]] subtree  are used to define the names of variables in the [[#Variables subtree|Variables subtree]].&lt;br /&gt;
If more than one bank is defined, there will be multiple keys named for the bankname, which will be arrays whose elements contain the name of each variable in the bank.&lt;br /&gt;
These keys are added by the user.&lt;br /&gt;
&lt;br /&gt;
The Names array(s) (if present) will be used by the [[Status Page|mhttpd status page]] in the &lt;br /&gt;
[[Status Page#Equipment Information|display]] of the Equipment variables, and by the [[History System]] to generate tags.  See [[#Example Settings subtree|example]] above.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:ODB Tree]] [[Category:Equipment]] [[Category:History]]&lt;/div&gt;</summary>
		<author><name>Gerritzen</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/MidasWiki/index.php?title=History_System&amp;diff=2866</id>
		<title>History System</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/MidasWiki/index.php?title=History_System&amp;diff=2866"/>
		<updated>2019-06-05T11:31:47Z</updated>

		<summary type="html">&lt;p&gt;Gerritzen: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Pagelinks}}&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* [[/History ODB tree]]&lt;br /&gt;
* [[History Page]]&lt;br /&gt;
* [[Mhformat|MIDAS history file format]] &lt;br /&gt;
* [[Keys in the ODB /Logger tree|/Logger ODB tree]]&lt;br /&gt;
* [[Keys in the ODB /Logger/History subtree|/Logger/History subtree]]&lt;br /&gt;
* &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;history file&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
The history system is an add-on capability built into the MIDAS data logger [[mlogger]] to record useful information in parallel to the data logging.&lt;br /&gt;
This information is recorded with a time stamp and saved into a &#039;&#039;&#039;history file&#039;&#039;&#039;  (see [[#History drivers|History drivers]]) for later retrieval. One set of files is created per day containing all the requested history events. The history data may be displayed in graphical form using the [[mhttpd]] MIDAS webserver utility, giving the user an easy way of seeing how experimental variables have changed with time.&lt;br /&gt;
The history logging will be in action only if the MIDAS data logger is running, but it is not necessary to have any [[Keys in the ODB /Logger tree#/Logger/Channels subtree|data logging channel]] enabled.&lt;br /&gt;
&lt;br /&gt;
= MidasHistoryInterface =&lt;br /&gt;
&lt;br /&gt;
The new history configuration defines history channels similar to logger channels. Each history channel creates a history interface class (class MidasHistoryInterface). The [[mlogger|data logger]] can use this interface to write data into the history, mhttpd, mhist &amp;amp; co can use this interface to read data from the history. The interface is defined in history.h&lt;br /&gt;
&lt;br /&gt;
* http://ladd00.triumf.ca/~daqweb/doc/midas/include/history.h&lt;br /&gt;
&lt;br /&gt;
= History drivers =&lt;br /&gt;
&lt;br /&gt;
Presently, the MIDAS distribution contains these drivers:&lt;br /&gt;
&lt;br /&gt;
; MIDAS-History &lt;br /&gt;
: this is the traditional history driver, with data stored in the .hst binary files. (format is documented here [[mhformat]], see also [[mhist]] and [[mhdump]])&lt;br /&gt;
: By default ODB subtree &#039;&#039;&#039;[[Keys in the ODB /Logger/History subtree#MIDAS subtree |&amp;quot;MIDAS&amp;quot;]]&#039;&#039;&#039; is set up to write MIDAS-history. &lt;br /&gt;
&lt;br /&gt;
; ODBC-History  &lt;br /&gt;
: stores history data in SQL database using the ODBC abstraction layer. See [[#MIDAS ODBC SQL History system|ODBC SQL History system]].&lt;br /&gt;
&lt;br /&gt;
: By default ODB subtree &#039;&#039;&#039;[[Keys in the ODB /Logger/History subtree#ODBC subtree|&amp;quot;ODBC&amp;quot;]]&#039;&#039;&#039; is set up to write ODBC-history.&lt;br /&gt;
&lt;br /&gt;
; SQLITE-History &lt;br /&gt;
: stores data in SQL database as SQLITE3 .sqlite3 files. The SQL table format is similar to ODBC-history, performance is similar, no database server required.&lt;br /&gt;
: By default ODB subtree &#039;&#039;&#039;[[Keys in the ODB /Logger/History subtree#SQLITE subtree|&amp;quot;SQLITE&amp;quot;]]&#039;&#039;&#039; is set up to write SQLITE-history.&lt;br /&gt;
&lt;br /&gt;
; MYSQL-History&lt;br /&gt;
:&lt;br /&gt;
: By default ODB subtree &#039;&#039;&#039;[[Keys in the ODB /Logger/History subtree#MYSQL subtree|&amp;quot;MYSQL&amp;quot;]]&#039;&#039;&#039; is set up to write MYSQL-history.&lt;br /&gt;
&lt;br /&gt;
; FILE-History&lt;br /&gt;
: stores each variable in its own file, making it much easier to trace the history of a particular variable.&lt;br /&gt;
: By default ODB subtree &#039;&#039;&#039;[[Keys in the ODB /Logger/History subtree#FILE subtree|FILE]]&#039;&#039;&#039; is set up to write FILE-history.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More drivers can be easily added by the user (create history_xxx.cxx, add constructor to hs_get_history(), create the ODB subtree  &amp;lt;span style=&amp;quot;color:purple; font-style:italic&amp;quot;&amp;gt;/Logger/History/xxx/channel&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
= Location of History Files =&lt;br /&gt;
;MIDAS-history &lt;br /&gt;
:By default, the traditional MIDAS-history is enabled, writing history files into the MIDAS data directory path given by the ODB key [[Keys in the ODB /Logger tree#Data dir|Data dir]].&lt;br /&gt;
:If history data is important, it is recommended to write it to a directory that is backed up or archived. (The MIDAS data directory is usually located on a scratch data disk without backups).&lt;br /&gt;
 &lt;br /&gt;
:The location of the MIDAS-history data files can be changed by use of the ODB Key [[Keys in the ODB /Logger tree#History dir|History dir]]. &lt;br /&gt;
&lt;br /&gt;
;ODBC-History&lt;br /&gt;
:The location of ODBC-History files is ...&lt;br /&gt;
&lt;br /&gt;
;SQLITE-History &lt;br /&gt;
:The location of SQLITE-History files is the directory path given by the ODB key [[Keys in the ODB /Logger/History subtree#Sqlite dir|Sqlite dir]].&lt;br /&gt;
&lt;br /&gt;
;MYSQL-History&lt;br /&gt;
:The location of MYSQL-History files is ...&lt;br /&gt;
&lt;br /&gt;
;FILE-History&lt;br /&gt;
:The location of FILE-History files is the directory path given by the ODB key [[Keys in the ODB /Logger/History subtree#History dir|History dir]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types of History Events =&lt;br /&gt;
&lt;br /&gt;
There are two basic types of history events, which are defined in different ways:&lt;br /&gt;
&lt;br /&gt;
*    &amp;quot;[[#Frontend History Event|Frontend]]&amp;quot; (or &amp;quot;Equipment&amp;quot;) History event composed in the frontend. See [[#Frontend History Event|Frontend History Event]] for details.&lt;br /&gt;
*    &amp;quot;Virtual&amp;quot; (or &amp;quot;Links&amp;quot;) History event composed within the ODB under the  [[/History ODB tree#Links subtree|/History/Links subtree]]. See [[#Virtual History Event|Virtual History Event]] for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Both these history event definitions take effect when the data logger gets a start run [[Run States and Transitions|transition]]. Any modifications made during the run are not applied until the start of the next run.&lt;br /&gt;
&lt;br /&gt;
== Virtual History Event ==&lt;br /&gt;
The history of any ODB variable can be recorded in a &amp;quot;virtual&amp;quot; history event by creating a link to that variable in the [[/History ODB tree#Links subtree|/History/Links subtree]]. This is used for ODB variables that are not in an Equipment.&lt;br /&gt;
&lt;br /&gt;
; To enable Virtual History Events&lt;br /&gt;
: Create links as desired in [[/History ODB tree#Links subtree|/History/Links subtree]].&lt;br /&gt;
&lt;br /&gt;
History events are created for each entry under ODB subdirectory {{Odbpath|path=/History/Links}}.  &lt;br /&gt;
&lt;br /&gt;
Two types of links are permitted:&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt; ODB key {{Odbpath|path=/history/links/aaa}} is a link to a subdirectory&amp;lt;/dt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; db_watch() is setup to watch this subdirectory&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt; tags are created for each subdirectory entry (1 tag per entry)&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt; There is no possibility for naming array elements, so 1 tag per array, regardless of the number of elements.&amp;lt;/li&amp;gt; &amp;lt;/ol&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;ODB key {{Odbpath|path=/history/links/bbb}}  is a subdirectory with links to ODB values&amp;lt;/dt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt; &amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;db_watch is setup to watch each link target&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; tags are created for each link (1 tag per link)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; tag name is the link name (NOT the target name). There is no possibility for naming array elements&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;/dd&amp;gt;&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixing links and subdirectories is not permitted.&lt;br /&gt;
&lt;br /&gt;
The update period of history events created for {{Odbpath|path=/history/links}} is controlled by entries in  {{Odbpath|path=/history/links periods}}. Numeric values of periods are same as for a [[#Frontend History Event|Frontend History event]]. Numeric value 0 disables the history for a particular event.&lt;br /&gt;
&lt;br /&gt;
See [https://midas.triumf.ca/elog/Midas/1087 MidasElog#1087] for more information. &lt;br /&gt;
&lt;br /&gt;
== Frontend History Event ==&lt;br /&gt;
&lt;br /&gt;
Each  [[Frontend Operation#Equipments and Events|Equipment]] has the capability to generate &amp;quot;history data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; To enable Frontend History Events &lt;br /&gt;
&lt;br /&gt;
: Set the [[/Equipment ODB tree#Log history|Log history]] ODB key of each equipment to be logged &#039;&#039;&#039;non-zero&#039;&#039;&#039;. (See [[Equipment List Parameters#Log History|Log History parameter]]). (You may need to restart the frontend.)&lt;br /&gt;
&lt;br /&gt;
This causes the event contents to be copied to the  ODB [[/Equipment ODB tree#Variables subtree|/Equipment/&#039;&#039;&amp;lt;equipment-name&amp;gt;&#039;&#039;/Variables subtree]] for the use of the History system. history events are created by parsing the content of  {{Odbpath|path=/Equipment/&amp;lt;equipment-name&amp;gt;/variables}}.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each equipment, history is controlled by the value of {{Odbpath|path=/Equipment/&amp;lt;equipment-name&amp;gt;/common/period}} as follows:&lt;br /&gt;
* 0 = history disabled&lt;br /&gt;
* 1 = history is enabled&lt;br /&gt;
* &amp;gt;1 = history is enabled, throttled down&lt;br /&gt;
&lt;br /&gt;
The throttling is implemented in log_history()/watch_history() by this algorithm:&lt;br /&gt;
the very first history event is recorded, then all changed to the data are ignored until &amp;quot;period&amp;quot; seconds has elapsed. Then the next history event will be recorded, and following&lt;br /&gt;
changes will be ignored until &amp;quot;period&amp;quot; second elapses, and so forth. Period value &amp;quot;1&amp;quot; has special meaning - there is no throttling, all history events are logged. &lt;br /&gt;
&lt;br /&gt;
This information is from [https://midas.triumf.ca/elog/Midas/1087 MidasElog#1087].&lt;br /&gt;
&lt;br /&gt;
=== Sequence for frontend History Event ===&lt;br /&gt;
The main steps for the frontend History Event is as follows:&lt;br /&gt;
&lt;br /&gt;
* The user code in the frontend equipment Event Readout routines reads the data, placing it into a MIDAS data bank&lt;br /&gt;
* In mfe.c, if the key [[/Equipment ODB tree#Log history|Log history]] &amp;gt; 0 (i.e. the history system is enabled for this equipment), this data bank is written into ODB (by update_odb()).&lt;br /&gt;
* This ODB write triggers an ODB hot-link into mlogger&lt;br /&gt;
* The hot-link calls mlogger.c::log_history(), which calls hs_write() to write the data into the history file. The frequency of the history writes is specified by the number of seconds between writes stored in the ODB key [[/Equipment ODB tree#Log history|Log history]].&lt;br /&gt;
* history.c::hs_write() or history_odbc::hs_write_odbc() writes the data into a history file or into an SQL database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to Write History events =&lt;br /&gt;
*  Enable desired [[#To enable Frontend History Events|Frontend]] and/or [[#To enable Virtual History Events|Virtual]] history events&lt;br /&gt;
*  [[#Select the history driver|Select the history driver]]&lt;br /&gt;
*  Follow instructions below for selected driver:&lt;br /&gt;
** [[#Write MIDAS-History events|Write MIDAS-history events]]&lt;br /&gt;
** [[#Write ODBC-History events|Write ODBC-history events]]&lt;br /&gt;
** [[#Write SQLITE-History events|Write SQLITE-history events]]&lt;br /&gt;
** [[#Write MYSQL-History events|Write MYSQL-history events]]&lt;br /&gt;
** [[#Write FILE-History events|Write FILE-history events]]&lt;br /&gt;
&lt;br /&gt;
== Select the history driver ==&lt;br /&gt;
&lt;br /&gt;
* Select the  &#039;&#039;&#039;[[#History drivers|history driver]]&#039;&#039;&#039; and therefore the [[Keys in the ODB /Logger/History subtree#&amp;lt;history-logging-channel&amp;gt; subtrees|history-logging-channel]]  to use to write the MIDAS-history files. &lt;br /&gt;
* set [[Keys in the ODB /Logger/History subtree#Active|Active]] ODB key in the selected  [[Keys in the ODB /Logger/History subtree#&amp;lt;history-logging-channel&amp;gt; subtrees|history-logging-channel]]  to &amp;quot;y&amp;quot;. All other logging channels should be disabled.&lt;br /&gt;
* set  [[/History ODB tree#LoggerHistoryChannel|LoggerHistoryChannel]] ODB key to the selected [[#History drivers|History channel]].&lt;br /&gt;
&lt;br /&gt;
== Write MIDAS-History events   ==&lt;br /&gt;
* Enable desired [[#To enable Frontend History Events|Frontend]] and/or [[#To enable Virtual History Events|Virtual]] history events&lt;br /&gt;
* Perform steps in [[#Select the history driver|Select History Driver]] with [[#History drivers|history driver]] &amp;quot;MIDAS&amp;quot;.&lt;br /&gt;
* Restart [[mhttpd]] and [[mlogger]], start the run.&lt;br /&gt;
&lt;br /&gt;
MIDAS-history files will be saved into the  [[#Location of History Files|MIDAS-history data directory]]. &lt;br /&gt;
&lt;br /&gt;
== Write ODBC-History events  ==&lt;br /&gt;
&lt;br /&gt;
See [[#MIDAS ODBC SQL History system|MIDAS ODBC SQL History system]].&lt;br /&gt;
* If necessary, [[#Set up a MySQL database|set up a MySQL database]].&lt;br /&gt;
* Enable desired virtual and frontend history events (see [[#Virtual History Event|Virtual history events]] and [[#Frontend History Event|Frontend history events]]).&lt;br /&gt;
* Perform steps in [[#Select the history driver|Select History Driver]] with [[#History drivers|history driver]] &amp;quot;ODBC&amp;quot;.&lt;br /&gt;
* Check ODB Key [[Keys in the ODB /Logger/History subtree#Writer_ODBC_DSN|Writer_ODBC_DSN]] is set to &amp;quot;history writer&amp;quot; and Key [[Keys in the ODB /Logger/History subtree#Reader_ODBC_DSN|Reader_ODBC_DSN]] is set to &amp;quot;history reader&amp;quot; (the default values)&lt;br /&gt;
* set [[Keys in the ODB /Logger/History subtree#Debug|Debug]] to 1 if desired&lt;br /&gt;
* restart [[mlogger]] in verbose mode (i.e. mlogger -v), and observe how it issues SQL commands to create the tables and columns corresponding to MIDAS-history events and tags.&lt;br /&gt;
* restart [[mhttpd]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes&#039;&#039;&#039;&lt;br /&gt;
# [[mlogger]] is programmed to raise alarms if connection to SQL database is interrupted or if some events cannot be written into the database (i.e. data type mismatch, SQL syntax errors, etc). The traditional MIDAS-history never raised alarms because it &amp;quot;never failed&amp;quot; - other than from &amp;quot;disk full&amp;quot; errors, which are immediately obvious.&lt;br /&gt;
# With ODBC History enabled, [[mhttpd]] will only use history information from the SQL database to make history plots and to extract history variable names for the history plot editor. The ODB  {{Odbpath|path=/History}}  subtrees[[/History ODB tree#Tags subtree|Tags]] and [[/History ODB tree#Events subtree|Events]]  are not used.&lt;br /&gt;
# variable names presented to the user may change from MIDAS names to SQL names (use the history panel &amp;quot;Label&amp;quot; text fields to create permanent plot labels).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Write  SQLITE-history events  ==&lt;br /&gt;
 &lt;br /&gt;
No special configuration required. &lt;br /&gt;
&lt;br /&gt;
* Enable desired virtual and frontend history events (see [[#Virtual History Event|Virtual history events]] and [[#Frontend History Event|Frontend history events]]).&lt;br /&gt;
* Perform steps to [[#Select the history driver|Select History Driver]] with [[#History drivers|history driver]] &amp;quot;SQLITE&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* Create a directory for storage of sqlite history files&lt;br /&gt;
* save its path in the ODB key  [[Keys in the ODB /Logger/History subtree#Sqlite dir|Sqlite dir]]&lt;br /&gt;
* restart [[mhttpd]] and [[mlogger]]&lt;br /&gt;
&lt;br /&gt;
In the history data directory (in [[Keys in the ODB /Logger/History subtree#Sqlite dir|Sqlite dir]]) you should see files with name &amp;quot;mh_xxx.sqlite3&amp;quot; corresponding to your equipment and variable names. &lt;br /&gt;
&lt;br /&gt;
== Write  MYSQL-history events  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Enable desired virtual and frontend history events (see [[#Virtual History Event|Virtual history events]] and [[#Frontend History Event|Frontend history events]]).&lt;br /&gt;
* Perform steps to [[#Select the history driver|Select History Driver]] with [[#History drivers|history driver]] &amp;quot;SQLITE&amp;quot;.&lt;br /&gt;
...........&lt;br /&gt;
&lt;br /&gt;
== Write  FILE-history events  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Enable desired virtual and frontend history events (see [[#Virtual History Event|Virtual history events]] and [[#Frontend History Event|Frontend history events]]).&lt;br /&gt;
* Perform steps to [[#Select the history driver|Select History Driver]] with [[#History drivers|history driver]] &amp;quot;SQLITE&amp;quot;.&lt;br /&gt;
* Assign directory path for saved files using the ODB key [[Keys in the ODB /Logger/History subtree#History dir|History dir]].&lt;br /&gt;
...........&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= History Events =&lt;br /&gt;
The following information is derived from [https://midas.triumf.ca/elog/Midas/1087 MidasElog#1087].&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;history event&amp;quot; is a history atomic unit of data. Associated with each history event is a timestamp (unix time),&lt;br /&gt;
a name (limited to NAME_LENGTH in the old history) and a list of history tags that describe the individual data&lt;br /&gt;
values inside the history event.&lt;br /&gt;
&lt;br /&gt;
When making history plots in [[mhttpd]] (see [[History Page]]) for each curve on the plot, one selects a history event (from the list&lt;br /&gt;
of currently active events, recently active events or the list of all events that ever existed), then from the list of tags&lt;br /&gt;
inside the history event one selects the particular variable that will be plotted.&lt;br /&gt;
&lt;br /&gt;
== Old MIDAS history events ==&lt;br /&gt;
In the old MIDAS history, all history events are written into one history file (.hst file + optional .def and .idx event definition and time index files&lt;br /&gt;
which can be/are regenerated automatically from the .hst file). History events are identified by 16-bit history event IDs, the persistent mapping&lt;br /&gt;
from history event names and the 16-bit history event IDs is stored in ODB subtree {{Odbpath|path=/History/Events}}. In addition the list of all known history event tags is&lt;br /&gt;
stored in ODB subtree {{Odbpath|path=/History/Tags}}. For per-equipment history, the 16-bit history event ID is the value of ODB key [[/Equipment ODB tree#Event ID|/Equipment/&amp;lt;equipment-name&amp;gt;/Common/Event ID]].&lt;br /&gt;
&lt;br /&gt;
== SQL history events ==&lt;br /&gt;
In the SQL history (MySQL, SQLITE, etc), each history event is an SQL table. The history event tags are the SQL table columns.&lt;br /&gt;
&lt;br /&gt;
== FILE history events ==&lt;br /&gt;
In the new FILE history, each history event is written into a separate file, tag definition are recorded in text format in the file header, history event&lt;br /&gt;
data is appended to the file in binary format (fixed record size). If the history event definition is changed, a new file will be started.&lt;br /&gt;
&lt;br /&gt;
= History Event Construction =&lt;br /&gt;
The [[mlogger]] creates [[#Frontend history event]]s in open_history() by parsing the ODB subtree {{Odbpath|path=/equipment/&amp;lt;equipment-name&amp;gt;/variables}}. Each ODB entry under the {{Odbpath|path=variables/}} subtree is referred to as a &amp;quot;variable&amp;quot;. Each variable can be a single ODB value, an array of ODB values, or a subdirectory (corresponding to TID_STRUCT structured data banks). As each variable is processed, one or more tags are created to describe it. &lt;br /&gt;
&lt;br /&gt;
Single ODB values will generally produce a single tag, while arrays can produce (depending whether the array is &amp;quot;[[#Named Arrays|Named]]&amp;quot; or not)&lt;br /&gt;
* multiple tags  - one per array element (&amp;quot;Named&amp;quot; array) or&lt;br /&gt;
* one single tag - describing the whole array  &lt;br /&gt;
 &lt;br /&gt;
The code can generate two types of history:&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt; &amp;quot;per-equipment&amp;quot; history&amp;lt;/dt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt; will have the tags for all variables concatenated together into one single history event&amp;lt;/dd&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt; &amp;quot;per-variable&amp;quot; history&amp;lt;/dt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt; will have one history event defined for each variable. Inside could be one tag (for single odb values and unnamed array)  or multiple tags (for named arrays and structured data &lt;br /&gt;
banks).&amp;lt;/dd&amp;gt;&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Per-equipment history is the original MIDAS history implementation. Per-variable history was added to permit efficient data storage in SQL tables. Its initial implementation used 1 ODB hotlink for each variable and it was easy to exceed the maximum permitted number of ODB hotlinks (db_open_record()). To reduce consumption of hotlinks, db_watch() has been implemented and now per-variable history only uses 1 ODB hotlink per equipment.&lt;br /&gt;
&lt;br /&gt;
;NOTE&lt;br /&gt;
: With db_watch, per-equipment history is no longer available. &#039;&#039;&#039;Per-variable history is the new default&#039;&#039;&#039; (and the only option).&lt;br /&gt;
&lt;br /&gt;
[https://midas.triumf.ca/elog/Midas/1087 MidasElog#1087]&lt;br /&gt;
&lt;br /&gt;
= Construction of history event tags =&lt;br /&gt;
Currently,&lt;br /&gt;
* single ODB values are treated as arrays of length &amp;quot;1&amp;quot;&lt;br /&gt;
* string ODB entries are not permitted&lt;br /&gt;
&lt;br /&gt;
History event tags are constructed in the [[mlogger]] add_equipment(). Presently there are some quirks with the generation of history event tags (see  [https://midas.triumf.ca/elog/Midas/1088]),&lt;br /&gt;
e.g. single odb values are treated as arrays of length &amp;quot;1&amp;quot; and  &amp;quot;string&amp;quot; ODB entries are not permitted.&lt;br /&gt;
&lt;br /&gt;
For variables of type TID_KEY (subdirectories, corresponding to TID_STRUCT structured banks), one tag is generated for each subdirectory entry. Tag names for  {{Odbpath|path=/equipment/&amp;lt;equipment-name&amp;gt;/variables/aaa/bbb}} will be &amp;quot;aaa_bbb&amp;quot; (with an underscore). Subdirectory entries of type TID_KEY and TID_LINK are currently not supported.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For &amp;quot;[[#Named Arrays|Named Arrays]]&amp;quot;, individual tags are generated for each array element. Tag names are taken from the &#039;&#039;Names&#039;&#039; array. For empty tag names (empty names array), tags are &amp;quot;aaa_0&amp;quot;, &amp;quot;aaa_1&amp;quot;, etc (for {{Odbpath|path=/equipment/&amp;lt;equipment-name&amp;gt;/variables/aaa}}). &lt;br /&gt;
&lt;br /&gt;
For &amp;quot;[[#Named Arrays|Single Names Arrays]]&amp;quot;, tag names have the variable name appended (with a space), for  {{Odbpath|path=/equipment/&amp;lt;equipment-name&amp;gt;/variables/aaa}} and an empty names array, tags will be &amp;quot;aaa_0 aaa&amp;quot;, &amp;quot;aaa_1 aaa&amp;quot;, etc. For a populated names array, the tags will be &amp;quot;name0 aaa&amp;quot;, &amp;quot;name1 aaa&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
For unnamed arrays and single odb variables (in ODB, single odb variables are arrays of length 1), a single tag is generated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Named Arrays ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Named Arrays&#039;&#039;&#039; have a &amp;quot;Names&amp;quot; entry in {{Odbpath|path=/equipment/&amp;lt;equipment-name&amp;gt;/settings}}.&lt;br /&gt;
&lt;br /&gt;
For example, to add names to {{Odbpath|path=/equipment/&amp;lt;equipment-name&amp;gt;/variables/aaa}}, create a string array {{Odbpath|path=/equipment/&amp;lt;equipment-name&amp;gt;/settings/names aaa}}. The names array should be at least as long as the corresponding data array. Individual entries in the names array can be left blank (tag names will be &amp;quot;aaa_0&amp;quot;, &amp;quot;aaa_1&amp;quot;, etc). Duplicate tag names are not permitted.&lt;br /&gt;
&lt;br /&gt;
A single &amp;quot;Names&amp;quot; entry can be created to name all arrays in variables with the same names (&#039;&#039;&#039;&amp;quot;Single Names&amp;quot;&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Create {{Odbpath|path=/equipment/&amp;lt;equipment-name&amp;gt;/settings/names}} and arrays {{Odbpath|path=/equipment/&amp;lt;equipment-name&amp;gt;/variables/aaa}} and {{Odbpath|path=/equipment/&amp;lt;equipment-name&amp;gt;/variables/bbb}} will have &lt;br /&gt;
history tags &amp;quot;name0 aaa&amp;quot;, &amp;quot;name1 aaa&amp;quot;, &amp;quot;name0 bbb&amp;quot;, &amp;quot;name1 bbb&amp;quot;, etc. If &amp;quot;names&amp;quot; are left blank, tag names will be &amp;quot;aaa_0 aaa&amp;quot;, &amp;quot;aaa_1 aaa&amp;quot;, &amp;quot;bbb_0 bbb&amp;quot;, &amp;quot;bbb_1 bbb&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
In the [[mhttpd]] web server [[History Page]] variables viewer, &amp;quot;single name&amp;quot; arrays are displayed in a 2D table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information is from [https://midas.triumf.ca/elog/Midas/1088].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Historical note on MIDAS-History Tag names =&lt;br /&gt;
Tags are only used for MIDAS-history events. &lt;br /&gt;
&lt;br /&gt;
The mlogger/mhttpd implementation of &amp;lt;span style=&amp;quot;color:purple; font-style:italic&amp;quot;&amp;gt;/History/Tags&amp;lt;/span&amp;gt; has proved troublesome and we are moving away from it.&lt;br /&gt;
&lt;br /&gt;
;During the transition period:&lt;br /&gt;
:   Implementations starting with Version 4435 of [[mlogger]] and [[mhttpd]] (i.e. &amp;quot;new&amp;quot; versions) will now work &#039;&#039;&#039;without&#039;&#039;&#039; &amp;lt;span style=&amp;quot;color:purple; font-style:italic&amp;quot;&amp;gt;/History/Tags&amp;lt;/span&amp;gt;. The history tags are read directly from the history files themselves. To run in this mode, set  ODB key [[/History ODB tree#DisableTags|/History/DisableTags]] to &amp;quot;y&amp;quot;. Existing [[/History ODB tree#Tags subtree|/History/Tags subtree]] will be automatically deleted.&lt;br /&gt;
&lt;br /&gt;
Two downsides to running like this are&lt;br /&gt;
* it is slower and tags become non-persistent&lt;br /&gt;
* if some frontends have not been running for a while, their variables may vanish from the history panel editor.&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
== New-style History Tags ==&lt;br /&gt;
For the above two reasons, using &amp;lt;span style=&amp;quot;color:purple; font-style:italic&amp;quot;&amp;gt;/History/Tags&amp;lt;/span&amp;gt; is still recommended.  &lt;br /&gt;
However, the format of the tags is now changed to simplify management and reduce ODB size. &lt;br /&gt;
&lt;br /&gt;
; For NEW implementations&lt;br /&gt;
: the key [[/History ODB tree#CreateOldTags|CreateOldTags]] will not be present. &amp;quot;New-style&amp;quot; history tags will be created automatically in the [[/History ODB tree#Tags subtree|Tags subtree]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;If you have old-style tags&lt;br /&gt;
: [[mlogger]] will automatically convert the old tags to this new format (this is why you should make a backup of your ODB).&lt;br /&gt;
&lt;br /&gt;
** using &amp;quot;old&amp;quot; (i.e. pre Version 4435) mlogger with &amp;quot;new&amp;quot; mhttpd is OK: new mhttpd understands both formats of /History/Tags.&lt;br /&gt;
** using &amp;quot;old&amp;quot; mhttpd with &amp;quot;new&amp;quot; mlogger is OK provided the ODB key [[/History ODB tree#CreateOldTags|/History/CreateOldTags]] is set to &amp;quot;y&amp;quot; before starting mlogger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Old-style History Tags ==&lt;br /&gt;
Prior to versions 4435 of [[mlogger]] and [[mhttpd]], old-style history tags were generated.&lt;br /&gt;
See&lt;br /&gt;
* http://ladd00.triumf.ca/~daqweb/doc/midas-old/html/F_History_logging.html&lt;br /&gt;
for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MIDAS ODBC SQL History system =&lt;br /&gt;
&lt;br /&gt;
This section describes the internal workings of the MIDAS SQL history system.&lt;br /&gt;
&lt;br /&gt;
The SQL history system implements the MIDAS history using a SQL database for data storage instead of flat binary files.&lt;br /&gt;
&lt;br /&gt;
The SQL history code lives in a separate files history.h and history_sql.cxx. The present implementation uses the ODBC API for accessing SQL databases. &lt;br /&gt;
MySQL is fully supported, Pgsql support is partially implemented, support for arbitrary ODBC drivers should be easy to add in history_sql and most SQL operations are done using an interface class.&lt;br /&gt;
&lt;br /&gt;
Preliminary testing with MySQL and PgSQL indicates that disk space requirements are the same for both storage mechanisms using flat binary files or either of the 2 SQL databases. All 3 tested storage mechanisms store the data uncompressed. (Observed gzip-1 compression ratios from CERN-ALPHA history files are 50% or better).&lt;br /&gt;
&lt;br /&gt;
Preliminary testing also indicates that MySQL database is &amp;quot;not too slow&amp;quot; for use by T2K/ND280 slow control system. Using MySQL, performance seems to improve somewhat compared to traditional MIDAS-history because each SQL table is stored into a separate file, compared to everything-in-one-file in traditional MIDAS-history.&lt;br /&gt;
&lt;br /&gt;
== Set up a MySQL database ==&lt;br /&gt;
&lt;br /&gt;
In order to setup a MySQL database, the following is needed:&lt;br /&gt;
&lt;br /&gt;
*    the server hostname and port number&lt;br /&gt;
*    database name&lt;br /&gt;
*    user name and password.&lt;br /&gt;
&lt;br /&gt;
It is recommended to create 3 different users:&lt;br /&gt;
&lt;br /&gt;
*    a &amp;quot;root&amp;quot; user with full priveleges,&lt;br /&gt;
*    a &amp;quot;reader&amp;quot; user with read-only priveleges&lt;br /&gt;
*    and a &amp;quot;writer&amp;quot; user with &amp;quot;insert, create table, and add column&amp;quot; priveleges (no permission to drop table, remove columns, etc)&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
#Setup a MySQL database (RHEL/SL 5)&lt;br /&gt;
&lt;br /&gt;
 ssh root@localhost&lt;br /&gt;
 service mysqld start&lt;br /&gt;
 /usr/bin/mysql_secure_installation (enter current password for root: press &amp;lt;enter&amp;gt;, then accept  default answer &amp;quot;Y&amp;quot; to all questions)&lt;br /&gt;
 mysqladmin -p create history&lt;br /&gt;
 using mysql-administrator, create 2 users:&lt;br /&gt;
 history_writer, with database &amp;quot;history&amp;quot; schema privileges: select, insert, create, alter, index&lt;br /&gt;
 history_reader, with database &amp;quot;history&amp;quot; schema privileges: select&lt;br /&gt;
&lt;br /&gt;
#Setup $HOME/.odbc.ini file:&lt;br /&gt;
&lt;br /&gt;
 cat $HOME/.odbc.ini&lt;br /&gt;
 [history_writer]&lt;br /&gt;
 Description  = history_writer&lt;br /&gt;
 Driver       = /usr/lib64/libmyodbc3.so&lt;br /&gt;
 SERVER       = ladd05.triumf.ca&lt;br /&gt;
 PORT         =&lt;br /&gt;
 Database     = history&lt;br /&gt;
 OPTION       = 3&lt;br /&gt;
 SOCKET       =&lt;br /&gt;
 User         = history_writer&lt;br /&gt;
 Password     = ******&lt;br /&gt;
 [history_reader]&lt;br /&gt;
 Description  = history_reader&lt;br /&gt;
 Driver       = /usr/lib64/libmyodbc3.so&lt;br /&gt;
 SERVER       = ladd05.triumf.ca&lt;br /&gt;
 PORT         =&lt;br /&gt;
 Database     = history&lt;br /&gt;
 OPTION       = 3&lt;br /&gt;
 SOCKET       =&lt;br /&gt;
 User         = history_reader&lt;br /&gt;
 Password     =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: if you are using mhist you will need a separate .odbc.ini file for each user that you have connecting to the database (through MIDAS).&lt;br /&gt;
&lt;br /&gt;
== Layout of SQL tables ==&lt;br /&gt;
&lt;br /&gt;
* One table is created for each history event. Table name is the same as the history event name (as reported by [[mhdump]]).&lt;br /&gt;
* one column is created for each history tag (history variable). Column name is the same as the tag name (as reported by mhdump). For array tags, one column is created for each array element: array a[3] will produce columns a_0, a_1 and a_2.&lt;br /&gt;
* two special columns are always created: _i_time and _t_time are the timestamps in the UNIX-time integer format and in the SQL &amp;quot;time&amp;quot; format. (A priori, it is not clear which timestamp format is more useful for end users. mhttpd uses the _i_time integer time format). Note that this timestamp is the time when mlogger receives the hot-link signal (see above) and it can be a few seconds behind the time when the user placed the data into the MIDAS bank. For high precision (and sub-second time resolution) time stamps, users should generate their own timestamps and include them as part of the data itself.&lt;br /&gt;
* a special table called _history_index is created to remember the mapping between SQL names and MIDAS names for event names, variable name and tag names.&lt;br /&gt;
&lt;br /&gt;
=== Schema Evolution ===&lt;br /&gt;
&lt;br /&gt;
*    when new data fields are added, new SQL columns are created automatically&lt;br /&gt;
*    existing SQL columns are never deleted&lt;br /&gt;
*    arrays are expanded automatically, and arrays never shrink.&lt;br /&gt;
*    if the type of a data field changes, a conflict may occur with existing SQL columns, for example if previous type was &amp;quot;FLOAT&amp;quot; and new type is &amp;quot;DOUBLE&amp;quot;, the existing SQL columns would have the SQL data type &amp;quot;float&amp;quot;, too narrow to store new values. mlogger will complain about this. Such conflicts may be resolved by changing the type of the SQL column using SQL tools. In general, SQL names are created from MIDAS names by replacing all non-alphanumerical characters to an underscore &amp;quot;_&amp;quot;. If this procedure creates duplicate column names, the column names and made unique by appending them with a random number, i.e. MIDAS names &amp;quot;A+B&amp;quot; and &amp;quot;A-B&amp;quot; will be translated to &amp;quot;A_B&amp;quot; and &amp;quot;A_B_12345&amp;quot; (random integer). True MIDAS names are saved into the _history_index.&lt;br /&gt;
&lt;br /&gt;
[[Category:history]]&lt;/div&gt;</summary>
		<author><name>Gerritzen</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/MidasWiki/index.php?title=Keys_in_the_ODB_/Logger/History_subtree&amp;diff=2865</id>
		<title>Keys in the ODB /Logger/History subtree</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/MidasWiki/index.php?title=Keys_in_the_ODB_/Logger/History_subtree&amp;diff=2865"/>
		<updated>2019-06-05T11:30:38Z</updated>

		<summary type="html">&lt;p&gt;Gerritzen: /* MYSQL subtree */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Links ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* [[/Logger ODB tree| /Logger tree]] &lt;br /&gt;
* [[/History ODB tree| /History tree]]&lt;br /&gt;
* [[History System]]&lt;br /&gt;
* [[Logging to a mySQL database]]&lt;br /&gt;
* [[Keys in the ODB /Logger/Channels subtree| /Logger/Channels subtree]] &lt;br /&gt;
* [[Keys in the ODB /Logger/SQL subtree| /Logger/SQL subtree]] &lt;br /&gt;
* [[mlogger |MIDAS logger (mlogger)]] &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;/Logger/History&#039;&#039;&amp;lt;/span&amp;gt; subtree =&lt;br /&gt;
&lt;br /&gt;
The ODB &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;/Logger/History&#039;&#039;&amp;lt;/span&amp;gt;  subtree is a subdirectory of the [[Keys in the ODB /Logger tree | ODB /Logger tree]], created&lt;br /&gt;
when the MIDAS logger utility [[mlogger]] is started for the first time. The keys will be filled with default values which users may change as required to customize their experiments. &lt;br /&gt;
&lt;br /&gt;
When [[mlogger]] is started for the first time, it now creates &#039;&#039;&#039;five&#039;&#039;&#039; &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt; /Logger/History/&amp;lt;&#039;&#039;history-logging-channel&#039;&#039;&amp;gt;&amp;lt;/span&amp;gt; ODB subtrees to control the five default history-logging-channels&#039;&#039;,  named for each of the default &lt;br /&gt;
[[History System#History drivers|History drivers]]. &lt;br /&gt;
&lt;br /&gt;
The keys present in each history-logging-channel are described below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Example  =&lt;br /&gt;
The following example shows the &amp;lt;span style=&amp;quot;color:purple; font-style:italic&amp;quot;&amp;gt;/Logger/History &amp;lt;/span&amp;gt;  ODB subtree after creation by [[mlogger]]  (obtained using the [[odbedit]] &#039;&#039;&#039;ls&#039;&#039;&#039; command).  &lt;br /&gt;
See below for information on individual keys. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[local:midas:S]/&amp;gt;ls -r /Logger/History&lt;br /&gt;
History&lt;br /&gt;
    MIDAS&lt;br /&gt;
        Type                    MIDAS&lt;br /&gt;
        Active                  y&lt;br /&gt;
        Debug                   0&lt;br /&gt;
        PerVariableHistory      0&lt;br /&gt;
    ODBC&lt;br /&gt;
        Type                    ODBC&lt;br /&gt;
        Active                  n&lt;br /&gt;
        Debug                   0&lt;br /&gt;
        Writer_ODBC_DSN         history_writer&lt;br /&gt;
        Reader_ODBC_DSN         history_reader&lt;br /&gt;
    SQLITE&lt;br /&gt;
        Type                    SQLITE&lt;br /&gt;
        Active                  n&lt;br /&gt;
        Debug                   0&lt;br /&gt;
        Sqlite dir&lt;br /&gt;
    MYSQL&lt;br /&gt;
        Type                    MYSQL&lt;br /&gt;
        Active                  n&lt;br /&gt;
        Debug                   0&lt;br /&gt;
        MYSQL Writer            mysql_writer.txt&lt;br /&gt;
        MYSQL Reader            mysql_reader.txt&lt;br /&gt;
    FILE&lt;br /&gt;
        Type                    FILE&lt;br /&gt;
        Active                  n&lt;br /&gt;
        Debug                   0&lt;br /&gt;
        History dir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;&amp;lt;history-logging-channel&amp;gt;&#039;&#039;&amp;lt;/span&amp;gt; subtrees =&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;&#039;&#039;history-logging-channel&#039;&#039;&amp;gt; subtree in the [[#top|Logger/History subtree]]&lt;br /&gt;
is created  (by [[mlogger]]) to control one of the [[History System#History drivers|history drivers]] available, and named for that history driver.&lt;br /&gt;
&amp;lt;br&amp;gt;Presently the five following history-logging-channel subtrees are created :&lt;br /&gt;
* MIDAS&lt;br /&gt;
* ODBC&lt;br /&gt;
* SQLITE&lt;br /&gt;
* MYSQL&lt;br /&gt;
* FILE&lt;br /&gt;
(see [[#Example|Example]] above).&lt;br /&gt;
&lt;br /&gt;
By default, only the MIDAS-history logging channel is [[#active|Active]].&lt;br /&gt;
&lt;br /&gt;
;NOTE&lt;br /&gt;
: In older MIDAS versions, the history-logging-channel subtrees were named 0,1,2... respectively&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Keys common to all history logging channel subtrees ==&lt;br /&gt;
The following three keys are common to all [[#&amp;lt;history-logging-channel&amp;gt; subtrees|history logging channel subtrees]] :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Type&#039;&#039;&amp;lt;/span&amp;gt;===&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  [[History System#History drivers|History driver]] name&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each [[#&amp;lt;history-logging-channel&amp;gt; subtrees |history-logging-channel subtree]] contains a  &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Type&#039;&#039;&amp;lt;/span&amp;gt; key which specifies the type of &lt;br /&gt;
[[History System#History drivers|History driver]] for this channel.&lt;br /&gt;
&lt;br /&gt;
When the subtree is created, the &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Type&#039;&#039;&amp;lt;/span&amp;gt; key is set to the respective History driver name, e.g. &lt;br /&gt;
: ODB key &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;/Logger/History/&#039;&#039;&#039;MIDAS&#039;&#039;&#039;/Type&amp;lt;/span&amp;gt; will be set to &#039;&#039;&#039;&amp;quot;MIDAS&amp;quot;&#039;&#039;&#039; &lt;br /&gt;
: ODB key &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;/Logger/History/&#039;&#039;&#039;ODBC&#039;&#039;&#039;/Type&amp;lt;/span&amp;gt; will be set to &#039;&#039;&#039;&amp;quot;ODBC&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
and so on (see [[#Example|Example]] above for all five logging channels).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
---------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Active&#039;&#039;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; BOOL&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  &amp;quot;n&amp;quot;&lt;br /&gt;
&amp;lt;/div&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
Each [[#&amp;lt;history-logging-channel&amp;gt; subtrees |history-logging-channel subtree]] contains a  &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Active&#039;&#039;&amp;lt;/span&amp;gt; key&lt;br /&gt;
which enables or disables history logging in this channel.&lt;br /&gt;
&lt;br /&gt;
By default, only the MIDAS-history logging channel will be set active, i.e. ODB key &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;/Logger/History/&#039;&#039;&#039;MIDAS&#039;&#039;&#039;/Active&amp;lt;/span&amp;gt; will be set to &amp;quot;y&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
;Note&lt;br /&gt;
: This key in the [[#MIDAS subtree|MIDAS subtree]]  replaces obsolete key [[Keys in the ODB /Logger tree #/Logger/WriteFileHistory|/Logger/WriteFileHistory]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Debug&#039;&#039;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; INT&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  0&lt;br /&gt;
&amp;lt;/div&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
Each [[#&amp;lt;history-logging-channel&amp;gt; subtrees |history-logging-channel subtree]] contains a  &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Debug&#039;&#039;&amp;lt;/span&amp;gt; key&lt;br /&gt;
which controls the debug level for this channel. If set to 0, debugging is disabled.&lt;br /&gt;
&lt;br /&gt;
;Note&lt;br /&gt;
:This key in the [[#ODBC subtree|ODBC subtree]]   replaces obsolete key [[Keys in the ODB /Logger tree #/Logger/ODBC_Debug |/Logger/ODBC_Debug]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;MIDAS&#039;&#039;&amp;lt;/span&amp;gt; subtree ==&lt;br /&gt;
&lt;br /&gt;
This is the  [[#&amp;lt;history-logging-channel&amp;gt; subtrees| history-logging-channel subtree]]  that  controls   [[History System#History drivers|MIDAS-history]] logging.&lt;br /&gt;
&lt;br /&gt;
For those Keys common to all history-logging-channels see&lt;br /&gt;
*[[#Type|Type]]&lt;br /&gt;
*[[#Active|Active]]&lt;br /&gt;
*[[#Debug|Debug]]&lt;br /&gt;
&lt;br /&gt;
;Note&lt;br /&gt;
: By default, this logging channel will be set active.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following section(s) describe keys unique to the &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;MIDAS&#039;&#039;&amp;lt;/span&amp;gt; subtree :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;PerVariableHistory&#039;&#039;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; INT&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  0&lt;br /&gt;
&amp;lt;/div&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
This key is present in the [[#MIDAS subtree|MIDAS subtree]] (whose [[#Type|Type]] key set to &amp;quot;MIDAS&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
The default value of 0 is intended to operate the MIDAS-history in &amp;quot;traditional&amp;quot; mode. In this mode:&lt;br /&gt;
* there is one history record for each equipment&lt;br /&gt;
* history record id is equal to the equipment id&lt;br /&gt;
* Subtrees &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;/History/Events&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;/History/Tags&amp;lt;/span&amp;gt; are not required and can be safely deleted&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Note&lt;br /&gt;
: this key replaces obsolete key &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;/History/PerVariableHistory&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;ODBC&#039;&#039;&amp;lt;/span&amp;gt; subtree ==&lt;br /&gt;
&lt;br /&gt;
This is the  [[#&amp;lt;history-logging-channel&amp;gt; subtrees| history-logging-channel subtree]]  that  controls  [[History System#History drivers|ODBC-history]] logging.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For those Keys common to all history-logging-channels see&lt;br /&gt;
*[[#Type|Type]]&lt;br /&gt;
*[[#Active|Active]]&lt;br /&gt;
*[[#Debug|Debug]]&lt;br /&gt;
&lt;br /&gt;
;Note&lt;br /&gt;
:[[#Debug|Debug]] key in this subtree  replaces obsolete key [[Keys in the ODB /Logger tree #/Logger/ODBC_Debug |/Logger/ODBC_Debug]]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following section(s) describe keys unique to the ODBC subtree:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Writer_ODBC_DSN&#039;&#039;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  &amp;quot;history_writer&amp;quot;&lt;br /&gt;
&amp;lt;/div&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
This key is present in the  [[#ODBC subtree|ODBC]] subtree  (whose [[#Type|Type]] key is set to &amp;quot;ODBC&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
It contains the ODBC Data Source Name for writing and is used by [[mlogger]].&lt;br /&gt;
&lt;br /&gt;
;Note&lt;br /&gt;
: this key replaces obsolete key [[Keys in the ODB /Logger tree #/Logger/ODBC DSN |/Logger/ODBC DSN]] &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Reader_ODBC_DSN&#039;&#039;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  &amp;quot;history_reader&amp;quot;&lt;br /&gt;
&amp;lt;/div&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
This key is present in the [[#ODBC subtree|ODBC]] subtree  (whose [[#Type|Type]] key is set to &amp;quot;ODBC&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
It contains the ODBC Data Source Name for reading, and is used by [[mhttpd]] and [[mhist]] utilities.&lt;br /&gt;
&lt;br /&gt;
;Note&lt;br /&gt;
: this key replaces obsolete key  &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;/history/ODB_DSN&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;SQLITE&#039;&#039;&amp;lt;/span&amp;gt; subtree ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the  [[#&amp;lt;history-logging-channel&amp;gt; subtrees| history-logging-channel subtree]]  that  controls  [[History System#History drivers|SQLITE-history]] logging.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For those Keys common to all history-logging-channels see&lt;br /&gt;
*[[#Type|Type]]&lt;br /&gt;
*[[#Active|Active]]&lt;br /&gt;
*[[#Debug|Debug]]&lt;br /&gt;
&lt;br /&gt;
The following section(s) describe keys unique to the SQLITE subtree :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;Sqlite dir&#039;&#039;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  &lt;br /&gt;
&amp;lt;/div&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
This key is present in the [[#SQLITE subtree|SQLITE subtree]]  (whose [[#Type|Type]] key is set to &amp;quot;SQLITE&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
It contains the location of SQLITE database files, and is of the form &amp;quot;/file/system/path&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;MYSQL&#039;&#039;&amp;lt;/span&amp;gt; subtree ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the  [[#&amp;lt;history-logging-channel&amp;gt; subtrees| history-logging-channel subtree]]  that  controls  [[History System#History drivers|MYSQL-history]] logging.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For those Keys common to all history-logging-channels see&lt;br /&gt;
*[[#Type|Type]]&lt;br /&gt;
*[[#Active|Active]]&lt;br /&gt;
*[[#Debug|Debug]]&lt;br /&gt;
&lt;br /&gt;
The following section(s) describe keys unique to the MYSQL subtree :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;MYSQL Writer&#039;&#039;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  mysql_writer.txt&lt;br /&gt;
&amp;lt;/div&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
This key is present in the [[#MYSQL subtree|MYSQL subtree]]  (whose [[#Type|Type]] key is set to &amp;quot;MYSQL&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
It contains the name of the config file for the MYSQL database and the history writer account. This file should look similar to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
server=localhost&lt;br /&gt;
port=3306&lt;br /&gt;
database=history&lt;br /&gt;
socket=/var/lib/mysql/mysql.sock&lt;br /&gt;
user=history_writer&lt;br /&gt;
password=[password of mysql user]&lt;br /&gt;
buffer=10000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;MYSQL Reader&#039;&#039;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  mysql_reader.txt&lt;br /&gt;
&amp;lt;/div&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
This key is present in the [[#MYSQL subtree|MYSQL subtree]]  (whose  [[#Type|Type]] key is set to &amp;quot;MYSQL&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
It contains the name of the config file for the MYSQL database and the history reader account. This file should look similar to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
server=localhost&lt;br /&gt;
port=3306&lt;br /&gt;
database=history&lt;br /&gt;
socket=/var/lib/mysql/mysql.sock&lt;br /&gt;
user=history_reader&lt;br /&gt;
password=[password of mysql user]&lt;br /&gt;
buffer=10000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;FILE&#039;&#039;&amp;lt;/span&amp;gt; subtree ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the  [[#&amp;lt;history-logging-channel&amp;gt; subtrees| history-logging-channel subtree]]  that  controls  [[History System#History drivers|FILE-history]] logging.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For those Keys common to all history-logging-channels see&lt;br /&gt;
*[[#Type|Type]]&lt;br /&gt;
*[[#Active|Active]]&lt;br /&gt;
*[[#Debug|Debug]]&lt;br /&gt;
&lt;br /&gt;
The following section(s) describe keys unique to the FILE subtree :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color: purple;&amp;quot;&amp;gt;&#039;&#039;History dir&#039;&#039;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;column-count:3;-moz-column-count:3;-webkit-column-count:3&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Type:&#039;&#039;&#039; STRING&lt;br /&gt;
* &#039;&#039;&#039;Default:&#039;&#039;&#039;  &amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/div&amp;gt;	&lt;br /&gt;
&lt;br /&gt;
This key is present in the [[#FILE subtree|FILE subtree]]  (whose [[#Type|Type]] key is set to &amp;quot;FILE&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
It contains the name of the directory in which the FILE-history files are to be stored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--------------&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Logger Tree]] [[Category:History]]&lt;/div&gt;</summary>
		<author><name>Gerritzen</name></author>
	</entry>
</feed>