From OpenSCADAWiki
Jump to: navigation, search

Linkage with the dynamics

To provide the visualization interface of relevant data, data from the subsystem "Data acquisition (DAQ)" should be used. The nature of these data is as follows:

  1. parameters that contain some number of attributes;
  2. attributes of the parameter can provide information of five base types: "Boolean", "Integer", "Real", "String" and "Object";
     where appended the VCA modifiers: "Selectable"; String variants: "Text", "Translation", "Color", "Image", "Font", "Address"; Integer variants: "DateTime".
  3. attributes of the parameter can have their archive (history);
  4. attributes of the parameter can be set to read, write and with full access.

Given the first point, it is necessary to provide the possibility of group-based reference. To do this, we use the logical level concept.

According to point 2, the links provide a transparent type conversion and do not require a special configuration.

To satisfy the opportunities for accessing to archives, in accordance with the item 3, links make check of the attribute type, and in the case of connection to the "Address", the address of the link is put into the value.

In the VCA terms, the dynamic links and configuration of the dynamics are the one process, to describe a configuration of which the tab "Processing" of the widgets is provided. The tab contains a table of configuration of the attributes properties and the calculation procedure text of the widget.

Figure. Tab "Processing" of the configuration page of the widget.

In addition to configuration fields of the attributes the column "Processing" in the table provides, for selective using of the attributes in the computational procedure of the widget, and the columns "Configuration", "Configuration template", to describe the links configuration.

If the "Processing" column is true, then the variable {widget ID}_{attribute ID} becomes available in the computational procedure, for example cw_value.

The column "Configuration" allows to specify the link type of the widget attribute:

  • Constant — in the tab of widget links the field for indication of a constant appears, for example, of the special color or header of the template frames.
  • Input link — linkage with the dynamics for read-only.
  • Output link — linkage with the dynamics just for writing.
  • Full link — complete linkage with dynamic, read/write.
  • From style — take the value from the project's style.

The column "Configuration template" makes it possible to describe the groups of dynamic attributes. For example, it may be different types of parameters of the subsystem "DAQ" and other interface widgets. With the correct formation of this field, the mechanism of automatic assignment of attributes is worked, with only the parameter of the subsystem "DAQ" or the widget of the interface, which simplifies and accelerates the configuration process. Value of this column has the following format:

  • For constant: direct the attribute value.
  • For link: "{parameter}|{identifier}", where:
    • parameter — group of the attribute;
    • identifier — identifier of the attribute; same the value is compared with the attributes of the DAQ parameters with automatic linkage, after the group link indication.
  • For style: identifier-name of the style field.

There may be several types of links, that are defined by the prefix:

  • val: — Direct download value through the link mechanism. For example, the "val:100" link loads value 100 to the widget attribute. Often used in the absence of a terminal point of linking, for the purpose of directly setting the value.
  • prm: — Link to the parameter attribute or parameter, in general, for the attributes group of the "Data acquisition" subsystem. For example, the link "prm:/LogicLev/experiment/Pi/var" performs the access of the widget attribute to the parameter attribute of the subsystem "Data acquisition". Sign "(+)" at the end of the address indicate about successful linking and presence of the target. For object-type attributes, permissible hierarchical access to a specific property of the object, by specifying its path through the symbol '#', for example: "prm:/LogicLev/experiment/Pi/var#pr1/pr2".
  • wdg: — Link to the attribute of another widget or widget, in general, for the attributes group. For example, the link "wdg:/ses_AGLKS/pg_so/pg_1/pg_ggraph/pg_1/a_bordColor" performs the access of the attribute of one widget to the attribute of another one. Supported both absolute and relative paths of the links. The reference point of the address of the absolute link is the root object of the module "VCAEngine", which means — the first element of the absolute address is ID of the session or project. The first element, on the side of the session, drops, so the links, installed in the project, work there. Relative links take a countdown from the widget where the link is specified. A special element of relative link is an element of a higher node "..".
  • arh: — A special type of the link, available only for a separate attribute of the type "Address", which allows you to connect directly to the value archive ("arh:CPU_load"). It may be useful to specify the archive as a data source for the primitive "Diagram".

Processing of the links occurs at a period of the widget calculating in the following order:

  • receiving the data from the input links;
  • performing the calculation of the widget procedure;
  • transmission the values by the output links.

The figure shows a tab of links for group attributes, by specifying only the parameter. The following figure shows the individual attribute assignment.

Figure. Tab "Links" of the configuration page of the widget with the group assignment of the attributes by the specifying only the parameter.
Figure. Tab "Links" of the configuration page of the widget with the individual assignment of the attributes.

When placing a widget in the widget container, all links of the original widget are added to the list of resulting links of the widget container, however, only to a depth at one level of nesting.

Figure. Tab "Links" of the configuration page of the widgets container, including widgets with links.

From the foregoing it is clear that the links are set by the user during the configuration of the interface. However, in order to allow the creation of general-purpose frames with the function of providing detailed data of different sources of the same type, a dynamic linking mechanism is required. Such a mechanism is foreseen:

  • reserving the key identifier "<page>" for the group of attributes of links in general purpose frames;
  • dynamically assigning links to the identifier "<page>" in the process of opening a general-purpose frame by the signal from another widget.

Let's examine the example when we have the frame of general-purpose "Control panel of graph" and a lot of "Graphs" in different frames. "Control panel of graph" has links with the templates:

  • tSek -> "<page>|tSek"
  • tSize -> "<page>|tSize"
  • trcPer -> "<page>|trcPer"
  • valArch -> "<page>|valArch"

In this case, each widget "Graph" has attributes "tSek", "tSize", "trcPer" and "valArch". Calling the "Control panel of graph" by opening signal from any widget "Graph", the attributes of the "Control panel of graph" are linked together with the attributes of the "Graph" widget, according to the template. As a result, all changes in the "Control panel of graph" will be displayed on the graph, through these links.

If the "Graph" widget has external links to the parameters of the "Data acquisition" subsystem, the "Control panel of graph" links will be installed on the external source. Additionally, if the "Control panel of graph" will be declared the links to the missing attributes directly in the widget "Graph", then the search will be made for the presence of such attributes in the external source — the first one on which a direct link is established, performing, thereby, the addition of the missing links.

To visualize this mechanism the table is provided.

Table. The mechanism of the dynamic linkage.

Attributes of the "Control panel of graph" (the template of dynamic linkage) "Graph" attributes Attributes of the external "Parameter" Resulting link or value of the linking attribute
tSek (<page>|tSek) tSek - "Graph".tSek
tSize (<page>|tSize) tSize - "Graph".tSize
trcPer (<page>|trcPer) trcPer - "Graph".trcPer
valArch (<page>|valArch) valArch - "Graph".valArch
var (<page>|var) var var "Parameter".var
ed (<page>|ed) - ed "Parameter".ed
max (<page>|max) - - EVAL
min (<page>|min) - - EVAL