Data Register
There are two types of storage tags and alarms in Argos, the first is temporary storage that resides on a memory buffer that allows a brief history of behaving as a process variable for the other type of storage is required have the database engine PostgreSQL, which is permanently stored data previously configured.
Temporary Storage:
Create the historical data in XML:
<historicos_xml>
<cola>/procesar_historicos</cola>
<tags>tendencias</tags>
<alarmas>alarmeros</alarmas>
<bd>
<nombre>horno1</nombre>
<esquema>argos</esquema>
<usuario>argos</usuario>
<pwd>argos</pwd>
</bd>
<mensaje>
<longitud>128</longitud>
<cantidad>4096</cantidad>
<alarmas_x_mensaje>50</alarmas_x_mensaje>
</mensaje>
<tiempo_escaner>10000</tiempo_escaner>
<tiempo_entre_consultas>100000</tiempo_entre_consultas>
<tiempo_descarga_lote>1</tiempo_descarga_lote>
<buffer_alarmas>1000</buffer_alarmas>
</historicos_xml>
Besides this you should identify the tags and alarms that you want to record, for it is necessary to modify the configuration files tags and alarms shown in the previous section Quick Start / Getting Started, simply adding <historicos> labels as shown in the following example:</historicos>
<tags_xml>
<cantidad>4</cantidad>
<nombre>tags</nombre>
<tag id="1" escritura="0">
<nombre>ganch_dist_freno</nombre>
<valor_x_defecto>10</valor_x_defecto>
<tipo>CORTO_</tipo>
<historicos>
<tipo>MUESTREO_</tipo>
<tiempo>100</tiempo>
<maximo>500</maximo>
<minimo>10</minimo>
<muestras>100</muestras>
<funciones>AVG_,STD_</funciones>
</historicos>
<dispositivo id="1" modelo="SIM">
<nombre>sim_mbtcp</nombre>
<registro direccion="300001" tipo="CORTO_" bit=""/>
</dispositivo>
</tag>
<tag id="2" escritura="1">
<nombre>ganch_aux_Freno_Mecanico_Elev</nombre>
<valor_x_defecto>1</valor_x_defecto>
<tipo>ENTERO_</tipo>
<historicos>
<tipo>MUESTREO_</tipo>
<tiempo>100</tiempo>
<maximo>500</maximo>
<minimo>10</minimo>
<muestras>100</muestras>
<funciones>AVG_,STD_</funciones>
</historicos>
<dispositivo id="1" modelo="SIM">
<nombre>sim_mbtcp</nombre>
<registro direccion="400001" tipo="ENTERO_" bit=""/>
</dispositivo>
</tag>
<tag id="3" escritura="1">
<nombre>ganch_aux_Pos</nombre>
<valor_x_defecto>1</valor_x_defecto>
<tipo>CARAC_</tipo>
<historicos>
<tipo>EVENTO_</tipo>
<tiempo/>
<maximo>500</maximo>
<minimo>10</minimo>
<muestras>100</muestras>
<funciones>AVG_,STD_</funciones>
</historicos>
<dispositivo id="1" modelo="SIM">
<nombre>sim_mbtcp</nombre>
<registro direccion="000001" tipo="CARAC_" bit=""/>
</dispositivo>
</tag>
<tag id="4" escritura="1">
<nombre>ganch_aux_Vel</nombre>
<valor_x_defecto>1</valor_x_defecto>
<tipo>BIT_</tipo>
<historicos>
<tipo>EVENTO_</tipo>
<tiempo/>
<maximo>500</maximo>
<minimo>10</minimo>
<muestras>100</muestras>
<funciones>AVG_,STD_</funciones>
</historicos>
<dispositivo id="1" modelo="SIM">
<nombre>sim_mbtcp</nombre>
<registro direccion="100001" tipo="BIT_" bit=""/>
</dispositivo>
</tag>
</tags_xml>
In the case of alarms is much simpler, should only be enabled storage, as shown below:
<alarmas_xml>
<cantidad>1</cantidad>
<nombre>alarmas</nombre>
<alarma id="1" escritura="1">
<grupo id="1" descripcion="central_hidraulica"/>
<subgrupo id="1" descripcion="bomba1" />
<nombre>sobrecorriente</nombre>
<estado_x_defecto>DESACT_</estado_x_defecto>
<valor_comparacion>50</valor_comparacion>
<tipo_comparacion/>
<historicos habilitado="1"/>
<origen tipo="registro">
<ubicacion id="1" modelo="SIM" nombre="sim_mbtcp" />
<dato direccion="100001" tipo="BIT_" bit=""/>
</origen>
</alarma>
</alarmas_xml>
With this setup and can start the "Registrar"
#> as-registrador -h historicos.xml -t tags.xml -a alarmas.xml
Permanent Storage:
For storage in the database engine PosgreSQL, use the same configuration files previously explained (historicos.xml, tags.xml and alarmas.xml), the difference lies in that it is carried out through a service different, which gets the variables and alarms generated circular buffer by the Registrar and transfer the database in configurable time intervals.
#> as-bd -h historicos.xml -t tags.xml -a alarmas.xml
Before creating the necessary storage environment in the database engine.
Argos user creation:
#> su - postgres
#> psql template1
postgres=#> CREATE USER argos WITH SUPERUSER CREATEDB LOGIN ENCRYPTED PASSWORD 'argos';
postgres=#> \q
Connecting with the new user to create the database and schema (Debian Lenny - PostgreSQL 8.3):
#> /usr/lib/postgres/8.3/bin/pg_ctl reload -D /var/lib/postgres/8.3/main
#> psql template1 -U argos
template1=#> CREATE DATABASE horno1;
template1=#> \c horno1
horno1=#> CREATE SCHEMA argos;
horno1=#> \q
This will get some tables that can be queried with SQL and stored the values of the variables and alarms set.