From OpenSCADAWiki
Jump to: navigation, search
Line 1: Line 1:
 
<languages/>
 
<languages/>
{{Constr|The translation checking and actualizing}}
 
 
<translate>
 
<translate>
 
<!--T:1-->
 
<!--T:1-->
Line 23: Line 22:
 
<!--T:2-->
 
<!--T:2-->
 
The module provides to OpenSCADA support DB files of the DBF type. The module is based on the library for working with DBF software files "Complex2" of the firm NIIP "DIYA". The module allows you to perform actions on databases, tables and table contents.
 
The module provides to OpenSCADA support DB files of the DBF type. The module is based on the library for working with DBF software files "Complex2" of the firm NIIP "DIYA". The module allows you to perform actions on databases, tables and table contents.
 
 
  
 
== Operations over the database == <!--T:3-->
 
== Operations over the database == <!--T:3-->
The operations of opening and closing of the database is supported, with the possibility of creating a new database when you open and delete existing at the close. In terms of the subsystem "DB" of system OpenSCADA opening of DB is its registration for further using of it in the system.
+
The operations of opening and closing of the database is supported, with the possibility of creating a new database when you open and delete existing at the close. In terms of the subsystem "DB" of OpenSCADA, opening of DB is its registration for further using of the program. It also supports the operation of requesting the list of tables in the database.
  
 
<!--T:4-->
 
<!--T:4-->
Under the DB, in the case of the dbf-files it is meant the directory containing the dbf-files. Therefore, operation of the creating and deleting of the database - creates and deletes the directory where the table (dbf-files) are stored. The role of the address of database plays the full name of the directory with dbf-files. Access to the database is defined by the system rights of access to the directory.
+
Under a DB, in the case of DBF files, is meant a directory containing DBF files. Therefore, database creation and removal operations create and delete folders where tables (DBF files) are stored. The role of the database address is the full name of the folder with DBF files. Access to the database is determined by the system permissions of the folder.
  
 
== Operations over the table == <!--T:5-->
 
== Operations over the table == <!--T:5-->
The operations of opening and closing of the table with the possibility of creating a new table when you open and deleting the existing one at the closing are supported.
+
Supports opening, closing tables, with the possibility of creating a new table when opening and removing an existing one when closed.
  
 
<!--T:6-->
 
<!--T:6-->
Actually dbf-file is the table. Creation and deletion of tables implies creation and deletion of dbf-file. Table name is the name of dbf-file in the directory of DB. Access to the table are define by the rights of access to dbf-file.
+
Actually, the DBF file is a table. Creating and deleting a table involves creating and deleting a DBF file. The table name represents the name of the DBF file in the database folder. The permissions of the table are determined by the rights to access the DBF file.
  
== Operations over the contents of the table == <!--T:7-->
+
== Operations over the table content == <!--T:7-->
* Scanning of the records of the table;  
+
* scanning of the table records;
* Request the values of these records;  
+
* requesting the values of specified records;
* Setting the values of these records;  
+
* setting the values of specified records;
* Removing the records.
+
* removing the records.
  
 
<!--T:8-->
 
<!--T:8-->
API of subsystem "DB" suppose the access to the contents of the table on the value of key(s) fields. Thus, the operation of request of the record implies the preset of key columns of the object TConfig, which will fulfill the request. Creating a new record(string) is the installation of the values of record, which does not exist.
+
API of the subsystem "DB" suppose the access to the contents of the table on the value of key(s) fields. Thus, the operation of requesting of the record implies the preset of key columns of the object TConfig, which will do the request. Creating a new record (row) is performed by setting the record values that are missing.
  
 
<!--T:9-->
 
<!--T:9-->
The module allows you to dynamically change the structure of the database tables DBF. Thus, in the event of a discrepancy of the table and the structure determined by record, the structure of the table will be reduced to the the required structure of record. In the case of the request of the value of the record, and mismatching of the structures of record and the table there will be available only to the values of common elements of the record and table. The module does not track the order of the elements in the record and in the structure of the table!
+
The module allows you to dynamically change the structure of the database tables FireBird. So, in the case of inconsistency between the structure of the table and the structure of the record being set, the structure of the table will be brought to the desired structure of the record. In the case of requesting the record values and discrepancies between record structures and tables, only the values of the general entries of the record and the table will be obtained. The module does not track the order of the elements in the record and in the structure of the table!
  
 
<!--T:10-->
 
<!--T:10-->
While access to the values of the tables the synchronization is used by through the capture of the resource to have access to the table. This avoids the destruction of data in the case of multi-access!
+
When accessing table values, synchronization is used by capturing the resource to access the table. This prevents data corruption in the case of multithreaded access.
  
 
<!--T:11-->
 
<!--T:11-->
The types of the elements of dbf-file that correspond to types of elements of system OpenSCADA in the following way:
+
Types of elements of the DBF DB correspond to types of elements of OpenSCADA in the following way:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! The types of fields of system OpenSCADA !! Type of field of dbf-file
+
! Types of OpenSCADA fields !! Types of fields of DB DBF
 
|-
 
|-
|TFld::String || "C"  
+
| TFld::String || "C"  
 
|-
 
|-
|TFld::Integer, TFld::Real || "N"  
+
| TFld::Integer, TFld::Real || "N"  
 
|-
 
|-
|TFld::Boolean || "L"  
+
| TFld::Boolean || "L"  
 
|}
 
|}
  
== Productivity of DB == <!--T:12-->
+
== Productivity of the DB == <!--T:12-->
Measurement of productivity of DB were carried out by the test "DB" of the module of system tests "SystemTests", by performing operations over the records of the structure: "'''name char (20), descr char (50), val double (10.2), id int (7), stat bool, reqKey string, reqVal string'''".
+
Measurement of the DB productivity were carried out by the test "DB" of the tests module "SystemTests", performing operations over the records of the structure: "'''name char (20), descr char (50), val double (10.2), id int (7), stat bool, reqKey string, reqVal string'''".
 
</translate>
 
</translate>
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Operation !! K8-3000+,256M,120G !! Nokia N800, SD 2G !! Intel(R) Core(TM) i3 CPU 1.33GHz, 3G, HDD
+
! Operations for 1000 records, seconds !! K8-3000+,256M,120G !! Nokia N800, SD 2G !! Intel(R) Core(TM) i3 CPU 1.33GHz, 3G, HDD
 
|-
 
|-
| ''Creation of the 1000 records (sec.):''  || 1.07 || 37 || 0.382  
+
| ''Creating:''  || 1.07 || 37 || 0.382  
 
|-
 
|-
| ''Updating of the 1000 records (sec.):'' || 1.6 || 33.8 || 0.368  
+
| ''Updating:'' || 1.6 || 33.8 || 0.368  
 
|-
 
|-
| ''Getting of the 1000 records (sec.):'' || 1.0 || 34.32 || 0.362  
+
| ''Getting:'' || 1.0 || 34.32 || 0.362  
 
|-
 
|-
| ''Seeking of the 1000 records (sec.):'' || - || - || 0.064  
+
| ''Seeking:'' || - || - || 0.064  
 
|-
 
|-
| ''Seeking in preload of the 1000 records (sec.):'' || - || - || 0.064  
+
| ''Seeking in preload:'' || - || - || 0.064  
 
|-
 
|-
| ''Deleting of the 1000 record (sec.):'' || 0.95 || 37 || 0.371  
+
| ''Deleting:'' || 0.95 || 37 || 0.371  
 
|}
 
|}

Revision as of 11:22, 25 August 2018

Other languages:
English • ‎mRussian • ‎Українська
Module Name Version License Source Languages Platforms Type Author Description
DBF DB DBF 2.2 GPL2 bd_DBF.so en,uk,ru,de x86,x86_64,ARM DB Roman Savochenko
  Maxim Lysenko, 2009 — the page translation
DB module. Provides support of the DBF files version 3.0.

The module provides to OpenSCADA support DB files of the DBF type. The module is based on the library for working with DBF software files "Complex2" of the firm NIIP "DIYA". The module allows you to perform actions on databases, tables and table contents.

1 Operations over the database

The operations of opening and closing of the database is supported, with the possibility of creating a new database when you open and delete existing at the close. In terms of the subsystem "DB" of OpenSCADA, opening of DB is its registration for further using of the program. It also supports the operation of requesting the list of tables in the database.

Under a DB, in the case of DBF files, is meant a directory containing DBF files. Therefore, database creation and removal operations create and delete folders where tables (DBF files) are stored. The role of the database address is the full name of the folder with DBF files. Access to the database is determined by the system permissions of the folder.

2 Operations over the table

Supports opening, closing tables, with the possibility of creating a new table when opening and removing an existing one when closed.

Actually, the DBF file is a table. Creating and deleting a table involves creating and deleting a DBF file. The table name represents the name of the DBF file in the database folder. The permissions of the table are determined by the rights to access the DBF file.

3 Operations over the table content

  • scanning of the table records;
  • requesting the values of specified records;
  • setting the values of specified records;
  • removing the records.

API of the subsystem "DB" suppose the access to the contents of the table on the value of key(s) fields. Thus, the operation of requesting of the record implies the preset of key columns of the object TConfig, which will do the request. Creating a new record (row) is performed by setting the record values that are missing.

The module allows you to dynamically change the structure of the database tables FireBird. So, in the case of inconsistency between the structure of the table and the structure of the record being set, the structure of the table will be brought to the desired structure of the record. In the case of requesting the record values and discrepancies between record structures and tables, only the values of the general entries of the record and the table will be obtained. The module does not track the order of the elements in the record and in the structure of the table!

When accessing table values, synchronization is used by capturing the resource to access the table. This prevents data corruption in the case of multithreaded access.

Types of elements of the DBF DB correspond to types of elements of OpenSCADA in the following way:

Types of OpenSCADA fields Types of fields of DB DBF
TFld::String "C"
TFld::Integer, TFld::Real "N"
TFld::Boolean "L"

4 Productivity of the DB

Measurement of the DB productivity were carried out by the test "DB" of the tests module "SystemTests", performing operations over the records of the structure: "name char (20), descr char (50), val double (10.2), id int (7), stat bool, reqKey string, reqVal string".

Operations for 1000 records, seconds K8-3000+,256M,120G Nokia N800, SD 2G Intel(R) Core(TM) i3 CPU 1.33GHz, 3G, HDD
Creating: 1.07 37 0.382
Updating: 1.6 33.8 0.368
Getting: 1.0 34.32 0.362
Seeking: - - 0.064
Seeking in preload: - - 0.064
Deleting: 0.95 37 0.371