Structures and databases

Devices


Structures and databases

D2000 system defines the term structure as particular number of named items, to which it is possible to specify the properties as value type, start value, saving start value, limits. Structure in the system is defined by an object Structure definition, so a specific name is assigned to it. Structure definition (holds no value) represents particular model, which is used (by the form of reference) in definition of other objects:

Object of Structured variable type is closely associated with an object of Structure definition type. It defines non-zero number of rows of values. Structure of each row is given by an object of Structure definition type. A value matrix is created:

Example:
The object SD.PersonDef of Structure definition contains the following items:

Item nameItem type
NameText
AgeInteger
BornAbsolute time
ChildrenInteger

The object SV.Persons is Structured variable type and contains five (5) rows. Rows of this objects are defined by the object SD.PersonDef. Object value includes of twenty (20) values [5 x 4] of various types, arrangement of which is shown in the following table:

Row/ColumnNameAgeBornChildren
1



2



3



4



5



Each item represents one value, for which there are defined (and especially for each value) all usual properties in D2000 system (start value, limits, status bits etc.). Individual values can be displayed in pictures, used in expressions (SV.Persons[3]^Age), in eval tags or events.

Using an object of Database type, it is possible to access a SQL database (via the interface ODBC), structure of which (names and types of columns) corresponds to an object of Structure definition type.

For each column (item) at the level of an object of Structure definition it is possible to define the following attributes:

These properties are used (or they are not, according to configuration) for columns in object of Structured variable and Database types. For object of Structured variable type, these properties can be configured for each item (value) individually.

* Attribute is defined at the level of object of Structure definition type and cannot be changed.


Devices

V niektorých prípadoch sa pri používaní štruktúr prejavujú určité nevýhody:

Uvedené problémy rieši koncepcia zariadení, ktorú prináša D2000 vo verzii 21. Zariadenie je možné vnímať ako jednoriadkovú štruktúrovanú premennú, pričom:

Pre každú položku na úrovni objektu Definícia zariadenia je možné definovať nasledujúce atribúty:

Tieto vlastnosti sú použité (alebo nepoužité podľa konfigurácie) pre položky v objekte typu Zariadenie. Pre objekt typu Zariadenie sa tieto vlastnosti dajú konfigurovať pre každú položku zvlášť (s výnimkou atribútov označených hviezdičkou).

* Atribút je pevne a nemenne definovaný na úrovni objektu typu Definícia zariadenia.