OpenSCADAWiki: Home Page En/Doc/API/part17
 

17. Organization and structure of the database of the system components

Nodes and subsystems of OpenSCADA may have their own tables in the database to store their own data. The structure of tables is individual and determined by the <TConfig> object. Nodes and subsystems must create and configure the <TConfig> object under their demands.

17.1. System tables

OpenSCADA system has two system tables: BD and SYS. Table BD contains records of registered databases and the table SYS contains data of system-wide parameters.

Table 7. Structure if the table of system-wide parameters (SYS).
User <user>Parameter's ID <id>Parameter's value <val>
root/DemoStation/MessLev0
user/DemoStation/Workdir/mnt/home/roman/work/OScadaD/share/OpenScada
user/DemoStation/UI/QTStarter/StartModQTCfg

Table 8. Structure if the table of registered DB.
ID <ID>DB Type <TYPE>Name <NAME>Description <DESCR>Address <ADDR>Codepage of the database contents <CODEPAGE>To enable <EN>
LibBDMySQLFunction's library server.diya.org;roman;123456;oscadaUserLibsKOI8-U1
AnastModelSQLiteAGLKS model ./DATA/AGLKSModel.dbUTF81
GenDBMySQLMain DB server.diya.org;roman;123456;oscadaDemoStKOI8-U1

17.2. Tables of the "Data acquisition" subsystem

Controllers (data sources) of the subsystem "Data acquisition" are stored in the tables of their subsystems named DAQ_<ModName>. The structures of these tables can differ significantly, but all of them have the obligatory fields. The overall structure of the controllers' tables is presented in table 9.

Table 9. The overall structure of the controllers' tables of the subsystem "Data acquisition" (DAQ_<ModName>).
ID <ID>Controller's name <NAME>Description <DESCR>To enable<ENABLE>To start <START>Individual parameters
AutoDAAutomatic sourceData acquisition from active sources with automatic identification of them.11 ...

Like the controller's table, the parameter's table for different types of data sources can differ significantly, but also have the obligatory fields. In addition to the differences which is typical to the type of data source, parameter's tables can still be different for different types of parameters. The overall structure of the parameters' tables is given in Table 10.

Table 10. The overall structure of the parameters' tables of the subsystem "Data acquisition".
Parameter's shifr <SHIFR>Parameter's name <NAME>Parameter's description <DESCR>To enable <EN>Individual parameters
P3P3Pressure on the diaphragm1...

In addition to controllers and parameters the subsystem "Data acquisition" contains parameter's templates. Parameter's templates are grouped by templates' libraries and are stored in tables of three types: templates' library table (ParamTemplLibs) — table 11, parameter's templates table — table 12 and template's parameters table — table 13.

Table 11. Structure of the templates' library table.
ID <ID>Name <NAME>Description <DESCR>DB table of the library <DB>
baseBasic templatesBasic templates' librarytmplib_base
S7 Templates' Library for Siemens S7 series controllers.tmplib_S7

Table 12. Structure of the templates' table.
ID <ID>Name <NAME>Description <DESCR>Text of the template procedure <PROGRAM>
digAlarmDigital signalAlarm over the discrete parameterJavaLikeCalc.JavaScript
simpleBoardSimple boardsFormation of the simple boards of the analog signal.JavaLikeCalc.JavaScript

Table 13. Structure of the table of the template's parameters.
Template's ID <TMPL_ID>Parameter's ID <ID>Name <NAME>Type <TYPE>Flags <FLAGS>Value <VALUE>Position <POS>
digAlarminÂõîä3144 2
digitBlockcmdOpenOpen command3161 0

17.3. Tables of the "Transports" subsystem

Subsystem "Transports" is divided into incoming and outgoing transports. For each type of transport there is its own table with its own structure. Table names, respectively: Transport_In and Transport_Out. Tables can be supplemented by fields, typical to the type of transport.

Table 14. Structure of the incoming transport's table (Transport_in).
ID <ID>Type <MODULE>Name <NAME>Description <DESCRIPT>Address <ADDR>Protocol <PROT>To start <START>Individual fields of the transports' types
web1SocketsWeb 1Work web transport for proced http requests.TCP::10002:0HTTP1...
SelfSelfSystemTCP 1Test TCP input socket!SocketsTCP::10001:11...

Table 15. Structure of the outgoing transport's table (Transport_out).
ID <ID>Type <MODULE>Name <NAME>Description <DESCRIPT>Address <ADDR>To start <START>Individual fields of the transports' types
tcp_o1SocketsTCP Out 1Output TCP transport 1TCP::100011...

For the centralized description of the list of external OpenSCADA stations it is used the table of external hosts (CfgExtHosts). The structure of this table is shown in Table 16.

Table 16. The structure of the table of external OpenSCADA hosts (CfgExtHosts).
User of the system <OP_USER>ID <ID>Name <NAME>Transport <TRANSP>Address of the remote host <ADDR>User of the external host <USER>Password of the user of the external host <PASS>
tcp_o1SocketsTCP Out 1Output TCP transport 1TCP::100011...

17.4. Tables of the "Archives" subsystem

Subsystem "Archives" contains three tables with fixed names:

Tables of the archivers can be complemented by fields, typical for each type of archiver.

Table 17. Structure of the table of the values' archive (Archive_val).
ID <ID>Name <NAME>Description <DESCR>To start <START>The mode of the values' source <SrcMode>Source of the values <Source>Type of the values <VTYPE>Buffer's periodicity <BPER>Buffer's size <BSIZE>Buffer's hard grid <BHGRD>High resolution of the buffer's time <BHRES>List of the serviced archivers <ArchS>
CPULoad_load 11DAQ.System.AutoDA.CPULoad.load4110000FSArch.1s;DBArch.1m;FSArch.1m;
ai1_dP 00 40.000110011FSArch.POMP_20070301;FSArch.1s;

Table 18. Structure of the table of the values' archivers (Archive_val_proc).
ID <ID>Archiver's type <MODUL>Name <NAME>Description <DESCR>To start <START>Address <ADDR>Values' period <V_PER>Archiving period <A_PER>Individual fields of the archivers' types
1sFSArch One second1ARCHIVES/VAL/1s160...
POMP_20070301FSArch 0ARCHIVES/VAL/POMP_200703010.000160...

Table 19. Structure of the table of the messages' archivers (Archive_mess_proc).
ID <ID>Archiver's type <MODUL>Name <NAME>Description <DESCR>To start <START>Template of the messages' category <CATEG>Messages' level <LEVEL>Address <ADDR>Individual fields of the archivers' types
StatErrorsFSArhStation error 1/DemoStation*4ARCHIVES/MESS/stError/...
NetRequstsFSArhNetwork requests 1/DemoStation/Transport/Sockets*1ARCHIVES/MESS/Net/...

17.5. Tables of the "Security" subsystem

Subsystem "Security" contains two tables: table of the system's users (Security_user) and groups of the system (Security_grp).

Table 20. Structure of the table of the system's users (Security_user).
Name <NAME>Description <DESCR>Password <PASS>Picture <PICTURE>
rootSuperUseropenscada
userUseruser

Table 21. Structure of the table of the system's users groups (Security_grp).
Name <NAME>Description <DESCR>Users in the group <USERS>
rootSuperUser's grouproot;user
usersUser's grouptoot;user

17.6. The structure of the databases of the modules

Each module can have its own database tables to store individual data. Structure of database tables of the modules can be formed freely, based on internal needs.