КНАУФ – профили для гипсокартона

КНАУФ - профили для гипсокартона Сертификаты

9. The primitives of the widget

Any newly created widget is based on one of several primitives (end element of the visualization) by installing of the kinship as directly to the primitive, as well as through the several intermediate user widgets. Each of the primitives contains a mechanism (logic) of the data model. A copy of the widget keeps the values of the properties of configuration of the the primitive specially for itself.

The tasks of the visualization interface includes support and work with the data model of the primitives of widgets. Primitives of the widget must be carefully developed and unitized in order to cover as many opportunities in the as possible to a smaller number of weakly connected with each other by their purpose primitives.

Table. The library of the primitives of widgets (basic elements of visualization)

IdNameFunction
ElFigure Elementary graphic figures

Primitive is the basis for drawing basic graphic shapes with their possible combinations in a single object. The support of the following basic figures is provided:

For all the figures contained in the widget it is set the common properties of thickness, color, etc., but this does not exclude the possibility of indicating the above attributes for each figure separately.

FormEl Elements of the form

Includes support for standard form components:

Text Text Text element (labels). Characterized by the type of font, color, orientation and alignment.
Media Media Element of visualization of raster and vector images of various formats, playback of animated images, audio segments and video fragments.
Diagram Diagram Element of the diagram with the support of the visualization of the flow of several trends, the spectrum, XY diagrams of real-time data, … .
Protocol Protocol Element of the protocol, visualizer of the system messages, with support for multiple operating modes.
Document Document The element of generating the reports, journals and other documentation on the basis of available in the system data.
Box Container Contains the mechanism for other widgets placement-including with the purpose of creation of new, more complex, widgets and pages of end visualization.
Function, in plane Function of API of the object model of OpenSCADA Not visual, on the side of execution, widget which allows to include a computing function of the object model of OpenSCADA in the VCA.

Table. The common set of properties/attributes in the widget

IdNameNumberValue
id Id Id of the element. The attribute is read-only, designed to provide information on the ID of the element.
path Path The path to the widget. The attribute is read-only and designed to provide full information about the location of the element.
parent Parent Path to the parent widget. The attribute is read-only and designed to provide information about the location of ancestor which the widget is inherited from.
owner Owner The widget owner and group in form “{owner}:{group}“, by default the “root:UI”.
perm Permission

Permission to the widget in form “{user}{group}{other}” plus inheritance flag, includes the inheritance owner and it’s permissions from upper widget.
Where “user“, “group” and “other” is:

By default the 01000(inheritance).

root Root 1 Id of the widget-primitive (basic element) which underlies the image of visualization of the widget.
name Name Name of the element. Modifiable the element name.
dscr Description Description of the element. Text field, serves for attachment to the widget of the brief description.
en Enabled 5 The state of the element — “Enabled”. Disabled element is not shown in the execution mode.
active Active 6 The state of the element — “Active”. Active element may receive focus in the execution mode, and thus receive keyboard and other events with their subsequent processing.
geomX Geometry:x 7 Geometry, coordinate ‘x’ of the element position.
geomY Geometry:y 8 Geometry, coordinate ‘y’ of the element position.
geomW Geometry:width 9 Geometry, the width of the element.
geomH Geometry:height 10 Geometry, the height of the element.
geomXsc Geometry:x scale 13 The horizontally scale of the element.
geomYsc Geometry:y scale 14 The vertical scale of the element.
geomZ Geometry:z 11 Geometry, coordinate ‘z’ (level) of element on the page. It also defines order to transfer the focus through active elements.
geomMargin Geometry:margin 12 Geometry, the margins of the element.
tipTool Tip:tool 15 The text of a brief help or tip on this element. Usually is realized as a tool tip, while keeping your mouse cursor over the element.
tipStatus Tip:status 16 Text information on the status of the element or the guide to action over the element. Usually is implemented in the form of a message in the status bar while keeping your mouse cursor over the element.

* Modification from session of the attribute of the root page will record the message in the status bar of the visualization window session.

contextMenu Context menu 17

Context menu in form strings list: “{ItName}:{Signal}“.
Where:

evProc Events process

Attribute for storing of the script of the processing of event of direct control of user interface. Script is the list of commands to the visualization interface generated at the event receipt (attribute event). Direct events processing for pages manipulation in form: “{event}:{evSrc}:{com}:{prm}“. Where:

Examples:

Additional attributes for items placed into the project in the role of a page.
pgOpen Page:open state Sign “The page is open”.

* Modification from session provides an immediate opening/closing the page.

pgNoOpenProc Page:process not opened Sign “Execute the page, even if it is closed”.
pgOpenSrc Page:open source 3 Full address of the page which has opened this one.

* Write/clear address of the widget — (opening initiator) performs an immediate opening/closing page. In the case of write the address and on certain conditions carried the dynamic linking of the current widget to the initiator.

pgGrp Page:group 4 The group of the page.
Additional attributes of the execution mode — by the session.
event Event Special attributes for the collection of events of the widget in the list, which is divided by the new line. Access to the attribute is protected by the resource allocation in order to avoid loss of the events. The attribute is always available in the script of widget.
load Load -1 The virtual command of the group data download.
focus Focus -2 The special attribute of the indicating the fact of receiving the focus by an active widget. Attribute of the widget and of the the embedded widgets is available in the script of widget.
perm Permission -3 The virtual attribute of the rights verification of active user on the viewing and control over the widget.

* — The special function of the widget attribute which running in a session of the project at any user’s modification.

The visualization engine provides visualizer specific attributes activation. The process of activation does at a session of the project opening and minds for the project: creation of the specific attribute with pointed properties, at case it lack, and activation for modification tracing by the visualization engine, like to the attributes of forming primitive’s shapes. For the specific attributes list of the visualizer you can see to proper documentation of the visualizer.

Elementary graphic figures (elfigure)

Primitive is the basis for drawing basic graphic shapes with their possible combinations in a single object. Taking into account the wide range of various shapes, which must be maintained by the primitive, and at the same time the primitive must be simple enough for using and, if possible, for implementation, it was decided to limit the list of the basic figures used for the construction of the resulting graphics to these figures: line, arc, Bézier curve and fill of the enclosed spaces. Based at these basic figures, it is possible to construct derived figures by combining the basic. In the context of the primitive, there is possibility to set the transparency of the color in the range [0…255], where ‘0’ — complete transparency.

Table. A list of additional properties/attributes of the primitive “ElFigure”

IdNameNumberValue
lineWdth Line:width 20 Line width.
lineClr Line:color 21

Color name form “{color}[-{alpha}]“, where:

Examples:

lineStyle Line:style 22 Line style (solid, dashed, dotted).
bordWdth Border:width 23 Line border width. The zero width indicates the lack of border.
bordClr Border:color 24 Border color (detailed in attribute 21).
fillColor Fill:color 25 Fill color (detailed in attribute 21).
fillImg Fill:image 26

Image name in form “[{src}:]{name}“, where:

Examples:

orient Orientation angle 28 The rotation angle of the content of widget.
elLst Element’s list 27

List of graphic primitives in the following format:

Where:

x, y

— direct point (x,y), coordinate in float point pixels;

p1 … pN

— dynamic point 1…N;

width, bord_w

— direct line and border width in float point pixels;

w{n}

— dynamic width ‘n’;

color, bord_clr, fill_clr

— direct line, border and fill color name or 32bit code with alpha: {name}[-{AAA}], #RRGGBB-AAA;

c{n}

— dynamic color ‘n’;

line_stl

— direct line style: 0-Solid, 1-Dashed, 2-Dotted;

s{n}

— dynamic style ‘n’;

fill_img

— direct fill image in form “[{src}:]{name}”, where:

i{n}

— dynamic fill image ‘n’.

For example:

The attributes for each point from the list of graphic figures elLst
p{n}x Point {n}:x 30 n*6 Coordinates ‘x’ of the point n.
p{n}y Point {n}:y 30 n*6 1 Coordinates ‘y’ of the point n.
w{n} Width {n} 30 n*6 2 Width n.
с{n} Color {n} 30 n*6 3 Color n (detailed in attribute 21).
i{n} Image {n} 30 n*6 4 Image n (detailed in attribute 26).
s{n} Style {n} 30 n*6 5 Style n.

Element of the form (formel)

Primitive is intended to provide the standard form elements to the user. The general list of attributes depends on the type of element.

Table. A set of additional properties/attributes of the primitive “FormEl”

IdNameNumberValue
elType Element’s type 20 Type of the element: “Line edit”, “Text edit”, “Check box”, “Button”, “Combo box”, “List”, “Tree”, “Table”, “Slider”, “Scroll bar”. On its value it depends a list of additional attributes.
Line edit:
value Value 21 The contents of the line.
view View 22 Type of the editing line: “Text”, “Combobox”, “Integer”, “Real”, “Time”, “Date”, “Date and Time”.
cfg Configuration 23

Configuration of the line. The format of the value of the field for different types of lines:

confirm Confirm 24 Enable the confirm mode.
font Font 25

Font name form “{family} {size} {bold} {italic} {underline} {strike}“, where:

Examples:

Text edit:
value Value 21 The contents of the editor.
wordWrap Word wrap 22 Automatic division of text by the words.
confirm Confirm 24 Enable confirm mode.
font Font 25 Font name form “{family} {size} {bold} {italic} {underline} {strike}” (details above).
Check box:
name Name 26 Name/label of the checkbox.
value Value 21 Value of the checkbox.
font Font 25 Font name form “{family} {size} {bold} {italic} {underline} {strike}” (details above).
Button:
name Name 26 Name, the inscription on the button. Allowed symbols ‘n’ for multiple line names.
value Value 21

The value, different for modes:

img Image 22

The image on the button. Image name in form “[{src}:]{name}“, where:

Examples:

color Color 23

Color of the button. Color name form “{color}[-{alpha}]“, where:

Examples:

colorText Color:text 27 The color of the text. (details above)
mode Mode 24

The button operation mode:

font Font 25 Font name form “{family} {size} {bold} {italic} {underline} {strike}” (details above).
List:
value Value 21 Current value of the list.
items Items 22 The entries of the list.
font Font 25 Font name form “{family} {size} {bold} {italic} {underline} {strike}” (details above).
mult Multiple selection 23 Allow for multiple entries selection of the list.
Combo box, Tree:
value Value 21 Current value of the list.
items Items 22 The entries of the list or hierarchical items list of tree in path “/{DIR}/{DIR}/{ITEM}“.
font Font 25 Font name form “{family} {size} {bold} {italic} {underline} {strike}” (details above).
Table:
set Setting value 23 The value of edition of a cell of the table which address into the event “ws_TableEdit_{colN}_{rowN}“.
value Value 21

Address of the selected item. It changing follows by the signal “ws_TableChangeSel“. The address format depends from the table’s selection mode:

items Elements 22

The table structure and content in XML view:

The tags:

“tbl” — Table, the properties at all:

“h” — The headers size, allowed attributes about cell-tag of the header, for the column as a whole:

“r” — the row of values, allowed attributes:

“s”, “i”, “r”, “b” — the data type’s cells “String”, “Integer”, “Real” and “Logical”. Allowed attributes:

font Font 25 Font name form “{family} {size} {bold} {italic} {underline} {strike}” (the details above).
Slider and Scroll Bar:
value Value 21 The slider position.
cfg Configuration 22

Configuration of the slider in the format: “{VertOrient}:{Min}:{Max}:{SinglStep}:{PageStep}“.
Where:

Про сертификаты:  Пожарный сертификат на ковролин в Москве, Санкт-Петербурге

Text element (text)

This primitive is designed to display the plain text used as labels, and different signatures. With the reason of creating a simple frequent decorations the primitive must support the surrounding of the text by frame.

Table. The list of additional properties/attributes of the primitive “Text”

IdNameNumberValue
backColor Background:color 20

Background color. Color name in form “{color}[-{alpha}]“, where:

Examples:

backImg Background:image 21

Background image. The image name in form “[{src}:]{name}“, where:

Examples:

bordWidth Border:width 22 Border width.
bordColor Border:color 23 Border color (detailed in attribute 20).
bordStyle Border:style 24 Border style: “None”, “Dotted”, “Dashed”, “Solid”, “Double”, “Groove”, “Ridge”, “Inset”, “Outset”.
font Font 25

Font name form “{family} {size} {bold} {italic} {underline} {strike}“, where:

Examples:

color Color 26 Text color (detailed in attribute 20).
orient Orientation angle 27 Orientation of text, rotation on angle.
wordWrap Word wrap 28 Automatic division of text by words.
alignment Alignment 29 Alignment of the text: “Top left”, “Top right”, “Top center”, “Top justify”, “Bottom left”, “Bottom right”, “Bottom justify”, “V center left”, “V center right”, “Center”, “V center justify”.
text Text 30 Text value. Use “%{x}” for argument “x” (from 1) value insert to.
numbArg Arguments number 40 Arguments number.
Attributes of the arguments
arg{x}val Argument {x}:value 50 10*x Argument x value.
arg{x}tp Argument {x}:type 50 10*x 1 Argument x type: “Integer”, “Real”, “String”.
arg{x}cfg Argument {x}:config 50 10*x 2

Argument x configuration:

Element of visualization of media materials (media)

This primitive is designed to play different media materials, ranging from simple images to the full audio and video streams.

Table. A set of additional properties/attributes of primitive “Media”

IdNameNumberValue
backColor Background:color 20

Background color. Color name in form “{color}[-{alpha}]“, where:

Examples:

backImg Background:image 21

Background image. The image name in form “[{src}:]{name}“, where:

Examples:

bordWidth Border:width 22 Border width.
bordColor Border:color 23 Border color (detailed in attribute 20).
bordStyle Border:style 24 Border style: “None”, “Dotted”, “Dashed”, “Solid”, “Double”, “Groove”, “Ridge”, “Inset”, “Outset”.
src Source 25

Media source name in form “[{src}:]{name}“, where:

Examples:

type Type 27

Media type variant:

  • “Image” — raster or vector(can not support) image, like: PNG, JPEG, GIF, SVG;
  • “Animation” — simple animation image, like: GIF, MNG;
  • “Full video” — full video, audio or stream, like: OGG, OGM, AVI, MKV, MPG, MP3, MP4.
areas Map areas 28 Number of active areas.
The attributes of the image (Image)
fit Fit to the widget size 26 Sign “Coordinate the contents with the size of the widget”.
The attributes of the video (Movie)
fit Fit to the widget size 26 Sign “Coordinate the contents with the size of the widget”.
speed Play speed 29 The speed of playback, as a percentage from the original speed. If the value is less than 1%, the playback stops.
The attributes of the full video (Full video)
play Play 29 Video/audio – “Play”.
roll Roll play 30 Roll play on the finish.
pause Pause 31 Playing pause.
size Size 32 Total video size (in milliseconds).
seek Seek 33 Seek video playing (in milliseconds).
volume Volume 34 Sound volume [0…100].
Active areas
area{x}shp Area {x}:shape 40 3*x Type of the area x: “Rect”, “Poly”, “Circle”.
area{x}coord Area {x}:coordinates 40 3*x 1 The coordinates of area x, are separated by commas: “x1,y1,x2,y2,xN,yN”
area{x}title Area {x}:title 40 3*x 2 Title of the area x.

This primitive targeted to construct various diagrams, including graphs/trends showing ongoing process and the archive data. Following types of the diagrams are implemented:

  • “Graph” — builds a graph of the values of a parameter in time
  • “Spectrum” — builds the frequency spectrum of values of a parameter. Window of the data of frequency spectrum is formed on the basis of the size of the widget horizontally, in pixels, and the available data of the parameters imposed on the horizontal grid size. In this regard, the minimum frequency is determined by the value of the attribute “tSize” — “1/tSize“, and maximum frequency of allocated frequencies is determined by half-width of the graph in pixels multiplied by the minimum frequency “width/(2*tSize)“.
  • “XY” — builds the two-dimensional graph of values of a parameter, by pairs to one graphic, where paired by axis Y (0,2,4…) and unpaired by axis X (1,3,5…). Sets time of the data range uses for values of the parameter obtain by axis X and Y, with follow sorting by the axis X and the imaging.

For all the diagram types possible as the data source sets:

Supported tracing of the current values and the values from the archive, and also the possibility of building the graphs of the parameters which have no archive of values, by the current values accumulation into the diagram buffer and only at the diagram active visibility moment.

The process of access to the archive data is optimized, by means of an intermediate buffer for the display, as well as the package of traffic data in the query, by way the data lead to quality enough for display.

Table. A list of additional properties/attributes of the primitive “Diagram”

IdNameNumberValue
backColor Background:color 20

Background color. Color name in form “{color}[-{alpha}]“, where:

Examples:

backImg Background:image 21

Background image. The image name in form “[{src}:]{name}“, where:

Examples:

bordWidth Border:width 22 Border width.
bordColor Border:color 23 Border color (detailed in attribute 20).
bordStyle Border:style 24 Border style: “None”, “Dotted”, “Dashed”, “Solid”, “Double”, “Groove”, “Ridge”, “Inset”, “Outset”.
trcPer Tracing period (s) 25 Mode and frequency of the tracing.
type Type 26 Diagram type: “Trend”, “Spectrum”, “XY”.
General attributes for all the types
tSek Time:seconds 27 Current time, seconds.
tUSek Time:microseconds 28 Current time, microseconds.
tSize Size, seconds 29 Size of the trend, seconds.
curSek Cursor:seconds 30 Cursor position, seconds.
curUSek Cursor:usek 31 Cursor position, microseconds.
curColor Cursor:color 32 Cursor color.
sclColor Scale:color 33 Color of the scale/grid (detailed in attribute 20).
sclHor Scale:horizontal 34 Horizontal mode of the scale/grid: “No draw”, “Grid”, “Markers”, “Grid and markers”, “Grid (log)”, “Markers (log)”, “Grid and markers (log)”.
sclHorScl Scale:horizontal scale (%) 44 Graphics’s horizontal scale in percents, excluding for type “XY”.
sclHorSclOff Scale:horizontal scale offset (%) 45 Offset of graphics’s horizontal scale in percents, excluding for type “XY”.
sclVer Scale:vertical 35 Vertical mode of the scale/grid: “No draw”, “Grid”, “Markers”, “Grid and markers”, “Grid (log)”, “Markers (log)”, “Grid and markers (log)”.
sclVerScl Scale:vertical scale (%) 40 Graphics’s vertical scale in percents.
sclVerSclOff Scale:vertical scale offset (%) 41 Offset of graphics’s vertical scale in percents.
sclMarkColor Scale:Markers:color 36 Color of the markers of the scale/grid (detailed in attribute 20).
sclMarkFont Scale:Markers:font 37

Font of the markers of scale/grid. Font name form “{family} {size} {bold} {italic} {underline} {strike}“, where:

Examples:

valArch Value archiver 38 Value archiver in form “{ArchMod}.{ArchivatorId}“.
valsForPix Values for pixel 42 The number of values per pixel. Increase to enhance the accuracy of export at large time intervals.
parNum Parameters number 39 The number of parameters that can be displayed on the one trend.
Attributes for type: “Graph”
sclHorPer Scale:horizontal grid size, seconds 43 Fixed a grid period of horizontal scale, disable automatic calculation for the grid period. Activated if the periods number into overall size more for two and one period size more for 15 pixels.
Individual attributes of the parameters of trend/graph/XY
prm{X}addr Parameter {X} :address 50 10*{X}

Full address to DAQ attribute of a parameter X or to an archive.
Also supported direct data set by the prefixes:

Example:

0 3.14
1 3.141
5 3.1415</d>” — data for 10 seconds and period 1 second from “25.05.2021 10:00:00”; at pass “tm” and “tm_grnd” it will sets values from the diagram range, and also by set attribute “s” it will allows the time set into seconds; “aprox” — approximate the throughout from one point to other instead the substitution previous value into all the periodical points (typically it is from packing);

prm{X}bordL Parametr {X}:view border:lower 50 10*{X} 1 Lower limit of the parameter X.
prm{X}bordU Parametr {X}:view border:upper 50 10*{X} 2 Upper limit of the parameter X.
prm{X}color Parametr {X}:color 50 10*{X} 3 Color for display of the trend of the parameter X (detailed in attribute 20).
prm{X}width Parametr {X}:width 50 10*{X} 6 Line width for display of the trend of the parameter X, in pixels.
prm{X}scl Parametr {X}:scale 50 10*{X} 5 Separated vertical scale mode of the parameter X: “Global”, “Markers”, “Grid and markers”, “Markers (log)”, “Grid and markers (log)”.
prm{X}val Parametr {X}:value 50 10*{X} 4 Value of the parameter X under the cursor.
prm{X}prop Parametr {X}:properties 50 10*{X} 7 Real archive properties in form “{BegArh}:{EndArh}:{DataPeriod}“, where “BegArh”, “EndArh”, “DataPeriod” — begin, end and period of archive’s data in seconds, real up to microseconds (1e-6).

Element of building the protocols based on the archives of messages (protocol)

This primitive is designed to visualize the data of the archive of messages through the formation of protocols with different ways of visualization, starting from a static scanning view and finishing with dynamic tracing of protocol of message.

Table. A list of additional properties/attributes of the primitive “Protocol”

IdNameNumberValue
backColor Background:color 20

Background color. Color name in form “{color}[-{alpha}]“, where:

Examples:

backImg Background:image 21

Background image. The image name in form “[{src}:]{name}“, where:

Examples:

font Font 22

Font of markers of scale/grid. Font name form “{family} {size} {bold} {italic} {underline} {strike}“, where:

Examples:

headVis Header visible 23 Show header for table or not.
time Time, seconds 24 Current time, seconds.
tSize Size, seconds 25 Query size, seconds. Set value to ‘0’ for get all alarms, for “lev” < 0.
trcPer Tracing period (s) 26 Mode and frequency of tracing.
arch Archivator 27 Messages archivator in form “{ArchMod}.{ArchivatorId}“.
tmpl Template 28

Category template or regular expression “/{re}/“. For template reserved special symbols:

lev Level 29 The level of messages. Set value to < 0 for get the current alarms.
viewOrd View order 30 View order: “By time”, “By level”, “By category”, “By messages”, “By time (reverse)”, “By level (reverse)”, “By category (reverse)”, “By messages (reverse)”.
col View columns 31

Visible and order columns list separated by symbol ‘;’. Supported columns:

itProp Item properties 32 Item’s properties number.
Individual attributes of the item’s properties
it{X}lev Item {X}:level 40 5*{X} Criterion: element’s level X, more or equal for pointed.
it{X}tmpl Item {X}:template 40 5*{X} 1 Criterion: element’s category template X (detailed in attribute 28).
it{X}fnt Item {X}:font 40 5*{X} 2 Element X font (detailed in attribute 22).
it{X}сolor Item {X}:color 40 5*{X} 3 Element X color (detailed in attribute 20).
Про сертификаты:  Перечень рабочих мест, на которых проводится специальная оценка условий труда и перечень их работ

Element of formation of documentation (document)

The primitive is designed to creation report, operational and other documents based on templates of documents.

Table. A list of additional properties/attributes of the primitive “Document”

IdNameNumberValue
style CSS 20 CSS rules in rows like “body { background-color:#818181; }“.
tmpl Template 21 Document’s template in XHTML, starts from tag “body” and include procedures parts:
doc Document 22 Final document in XHTML, starts from tag “body”.
font Font 26

Basic font of the text. Font name form “{family} {size} {bold} {italic} {underline} {strike}“, where:

Examples:

bTime Time:begin 24 Start time of the document, seconds.
time Time:current 23 Time of the document generation, seconds. Write the time for the document generation from that point or zero for regeneration.
n Archive size 25 Number of documents or the depth of the archive.
Attributes of the enabled archival mode
aCur Archive:cursor:current Position of the current document in the archive. Record of the value <0 produces the archiving of this document.
vCur Archive:cursor:view Current visual document of the archive. Writing a value of -1 — to select next document, -2 — to select previous document.
aDoc Archive:current document Current archive document in XHTML, starts from the tag “body”.
aSize Archive:size Real the archive document size.

Features of the primitive “Document”:

The basis of any document is XHTML-template. XHTML-template is the tag “body” of the WEB-page which contains the document’s static in the standard XHTML 1.0 and elements of the executable instructions in one of the languages of the user programming of OpenSCADA in the form of <?dp {procedure} ?>. The resulting document is formed by the execution of procedures and insert of their result into the document.

The source for values of the executable instructions are the attributes of the widget of the primitive, as well as all the mechanisms of the user programming language. Attributes may be added by the user and they can be linked to the actual attributes or parameters or they can be autonomous, values of which will be formed in the script of the widget. In the case of linked attributes the values can be extracted from the history, archive.

Fig. 3.8.7.a shows a block diagram of the widget of the primitive “Document”. According to this structure “Document” includes: XHTML-template, the resulting documents and the processing script. The data source for the script and for the resulting documents are the attributes of the widget.

It is provided the work of the widget in two modes: “Dynamic” and “Archive”. The difference between archive mode is the availability of the archive of the specified depth and attributes which allow you to control the process of archiving and viewing of the document in the archive.

Generation of the document is always performed at the time of installation of the time attribute time relatively to the set start time of the document in the attribute bTime. With the archive turned off the resulting document is placed directly in the attribute doc. When the archive is turned on the resulting document is placed in the cell under the cursor, the attribute aCur, as well as in doc if the value of the archive cursor aCur and the cursor of visualized document vCur match. Attributes of the archival cursors provide several commands of values:

As it was stated above dynamics of the document’s template is defined by the inserts of executable instructions of the form “<?dp {procedure} ?>“. The procedures may use the same attributes of the widget and functions of the user programming interface of OpenSCADA. In addition to the attributes of the widget special attributes (Table 3.8.7.a) are reserved.

Table 3.8.7.a. Special and reserved elements of the template.

NameAssignment
Attributes
rez Attribute of the results of the procedure execution, the contents of which is placed to the document tree.
lTime Last formation time. If the document is formed for the first time, lTime is equal to the bTime.
rTime Contains the time for the selected values in seconds, it is defined inside the tags with the attribute “docRept”.
rTimeU Contains the time for the selected values in microseconds, it is defined inside the tags with the attribute “docRept”.
rPer Contains the periodicity of the selection of values (the attribute “docRept”).
mTime, mTimeU, mLev, mCat, mVal It is defined inside the tags with an attribute “docAMess” when parsing messages of the messages’ archive:

mTime — message time;
mTimeU — message time, microseconds;
mLev — message level;
mCat — message category;
mVal — message value.

Special tags
Special attributes of the standard tags
body.docProcLang Language of executable procedures of the document. By defaults it is “JavaLikeCalc.JavaScript”.
*.docRept=”1s” Tag with the specified attribute, while the formation it multiplies through the time offset in the attribute “rTime” to the value, specified in this attribute.
*.docAMess=”1:PLC*” Indicates the necessity of the tag multiplication with an attribute of message from the archive of messages for the specified interval of time, in accordance with the level of “1” and template of request “PLC*” by the messages category. The template request may specify a regular expression in the form of “/{re}/“. For this tag in the process of multiplication the following attributes: mTime, mTimeU, mLev, mCat and mVal are defined.
*.docAMessArchs=”ArchMod0.Archivator0[;ArchModN.ArchivatorN]” The attribute “*.docAMess” appends by a list of archivators for messages reading.
*.docRevers=”1″ Points to invert of the order of multiplication, the last from the top.
*.docAppend=”1″ The sign of the necessity of addition of the procedure execution result in the tag of the procedure. Otherwise, the result of execution replaces the contents of the tag.
body.docTime Time of formation of the document. It is used to set the attribute lTime in the time of the next formation of the document. It is not set by the user!
table.export=”1″ Enable for selected table content allow for export to CSV-file and other table formats.

Container (box)

The primitive container is used to build composite widgets and/or the pages the user interface.

Table. A list of additional properties/attributes of the primitive Box

IdNameNumberValue
pgOpenSrc Page:open source 3 Full address of the page, included inside of the container.
pgGrp Page:group 4 Group of the container of the pages.
backColor Background:color 20

Background color. Color name in form “{color}[-{alpha}]“, where:

Examples:

backImg Background:image 21

Background image. The image name in form “[{src}:]{name}“, where:

Examples:

bordWidth Border:width 22 Border width.
bordColor Border:color 23 Border color (detailed in attribute 20).
bordStyle Border:style 24 Border style: “None”, “Dotted”, “Dashed”, “Solid”, “Double”, “Groove”, “Ridge”, “Inset”, “Outset”.

Организация защищенного шифрованием обмена между двумя контроллерами s7-1500 по протоколу opc ua

Протокол OPC UA (https://ru.wikipedia.org/wiki/OPC_UA) появился впервые в контроллерах Simatic во второй версии прошивки и в Step 7 версии 14. Тогда контроллер можно было настраивать только в качестве OPC UA – сервера, то есть ПЛК мог отвечать на запросы и отдавать данные, но не мог сам инициировать связь и опрашивать других участников сети.

Радикально ситуация меняется в ноябре-декабря 2021 года с выходом прошивки 2.6 и Step 7 версии 15.1. Появляется возможность настроить CPU в качестве OPC UA клиента. А это, в свою очередь дает нам возможность организовать защищенный канал обмена информацией машина-машина (контроллер-контроллер). И это важно (про существование Secure OUC мне так же известно, однако OUC являет собой обмен данными в свободном формате, чего хватает для маленьких объемов, но отсутствие строгого формата данных накладывает свой отпечаток…). Большинство протоколов полевого уровня для промышленности разрабатывалось в прошлом веке и рассчитаны они, в первую очередь, на честных людей. Только время идет, честных людей становится меньше, информационных злодеев – больше, поэтому обмен данными надо как можно лучше спрятать, зашифровать, запаролить, обложить сертификатами, а всем посторонним в ответ показывать обидные жесты и говорить неприличные слова.

К сожалению, к моменту написания данной заметки я не нашел готового Application Exampl’а на сайте технической поддержки (на самом деле, документ есть, просто плохо искал — см. п. 4 перечня литературы), поэтому, обложившись приведенными выше материалами, разобрался за пару вечеров. С настройкой серверной части попроще, на нее пример есть, а вот с клиентом пришлось немного поразбираться.

Итак, настройка контроллера (S7-1512 FW2.6) в качестве OPC UA сервера.

В процессе некоторых манипуляций в TIA Portal’е, вроде включения глобальных настроек безопасности, среда будет выдавать вам предупреждающие и временами даже угрожающие окна сообщений. При описании я не акцентировал на этом внимание, так что просто нажимайте кнопку ОК и со всем соглашайтесь.

По умолчанию OPC UA отключен в настройках, поэтому заходим в свойства CPU, ищем ветку OPC UA → Server → General и активируем OPC UA Server.

Использование OPC UA в контроллерах Simatic требует приобретение лицензии, поэтому покупаем лицензию, заходим в свойства Runtime licenses → OPC UA и ставим тип приобретенной лицензии. Лицензии бывают трех типов: маленькая, средняя и большая, в зависимости от типа CPU. S7-1510 и S7-1512 требуют «small».

По желанию можно задать Application name для OPC UA сервера, порт и временные интервалы. Интервалы сбора (sampling) и публикации (publishing) я выставил минимальными. Стоит помнить, что уменьшение интервалов повышает нагрузку на CPU. Имя приложения и номер порта оставил по умолчанию.

Базовая настройка закончена. Компилируем и грузим PLC.

Теперь проверим, работает ли вообще. Запускаем программу OPC UA Client (ее можно скачать с SIOS по первым двум ссылкам в начале заметки). Ставлю ip адрес моего контроллера — 192.168.43.10 и нажимаю кнопку Get Endpoints. Получаю возможные «точки входа»

Захожу по самому первому варианту, без сертификатов, без шифрования, без пароля, нажимаю «Connect to selected Endpoints» и перехожу на вкладку «Browse nodes». В контроллере загружена программа управления котельной, нахожу одну переменную (Node или узел — так называется «тэг» или «переменная» в протоколе)

В правой верхней части есть строчка Node id (идентификатор узла или «адрес переменной»), выделяю его мышкой и жму Ctrl-C

Перехожу на вкладку Read/Write, вставляю скопированный node id и нажимаю кнопку Read

Получаю прочитанное значение переменной равное 3. Действительно, все совпадает, насосы отопительного контура должны чередоваться в третий день недели, и именно эта цифра вбита в переменную DayOkWeek блока данных OKPumpsAuto.

Закрываю программу. Базовый функционал есть, и он работает. Но этого мало. Сейчас OPC UA сервер настроен на режим «заходи, кто хошь, бери, че хошь». Необходимо добавить немного безопасности.

Включаем «глобальные настройки безопасности» в свойствах CPU, Protection&Security → Certificate Manager, ставим галочку Use global settings…

В навигации всего проекта находим Security Settings → Settings. Смело нажимаем кнопку Protect this project. Действие необратимое, запомните. Снять защиту с проекта уже не получится. Дело в том, что оффлайновый проект будет содержать сертификаты серверной и клиентской машины, они должны быть защищены во избежании покражи. После нажатия кнопки Protect система предложит создать администратора проекта:

Теперь любое открытие проекта TIA Portal будет требовать ввода логина и пароля. Кроме администратора проекта, разумеется, можно и нужно создать пользователей с меньшими правами.

После того, как мы активировали глобальные настройки безопасности, необходимо заново вручную сгенерировать сертификат контроллера. В дальнейшем лучше, конечно же, сразу защищать проект, создавать администратора проекта и ставить контроллерам «глобальные настройки безопасности», но данная заметка частично носит общеобразовательный характер. Возвращаемся в настройки CPU, ищем OPC UA → Server →Security

Нажимаем кнопку «…» рядом с надписью «Server certificate»,а в появившемся окне — кнопку «Add new».

Создаем новый сертификат устройства, все значения остаются по умолчанию. Сертификат, как видно, подписан серьезной организацией! В итоге все становится вот так:

Сейчас предлагаю скомпилировать проект, загрузить его в ПЛК и проверить программой, как работает связь. На самом деле, в результате последних изменений в настройках уровень секьюрности не поднялся ни на йоту. Все это было лишь подготовительным процессом. Потихоньку приходит время приступать к настройкам контроллера, который будет играть роль OPC UA клиента, проверить обмен данными, ну а потом уже закрыть все бреши в безопасности. Но вначале необходимо выгрузить xml файл с описанием всех тэгов (узлов, nodes) контроллера-сервера. Этот файл формируется достаточно просто — система выбирает только те переменные, которые помечены флагом Accessible from HMI/OPC UA и разрешает их запись, если стоит флаг Writable from HMI/OPC UA . Например:

Про сертификаты:  Как удалить сертификаты с телефона Android? - Справочник по настройке компьютера

Для экспорта снова заходим в настройки CPU и ищем там OPC UA → Server → Export, нажимаем кнопку «Export OPC UA XML file»

Переходим к настройкам OPC UA клиента, то есть той стороны обмена, которая будет инициировать связь, запрашивать и записать переменные. В качестве клиентской части у меня выступает S7-1510 с прошивкой FW2.6.

Добавляю контроллер в проект и сразу активирую глобальные настройки безопасности.

Активирую OPC UA клиента

Активирую лицензию OPC UA

Генерирую сертификат этого второго, клиентского контроллера. В дальнейшем контроллер-сервер и контроллер-клиент обменяются (не без моей помощи) своими сертификатами, а подключение незнакомых устройств будет запрещено. В свойствах CPU идем на Protection & Security, жмем Add new.. в таблице Device certificates, жмем на кнопку «…» в появившейся пустой строке, жмем «Add new» в появившемся окне, наблюдаем уже знакомое окно создания нового подписанного сертификата:

В поле usage я дополнительно указал, что сертификат используется для OPC UA Client’а, по умолчанию у меня был выставлен Tls.

Наступает одно из самых интересных: настройка клиентского интерфейса,а точнее — настройка соединения к серверу и создания наборов данных для чтения и/или записи. В структуре проекта у второго (клиентского) контроллера:

PLC_2 → OPC UA communication → Client Interfaces →Add new client interface

Жмем кнопку «Import interface» и подгружаем ранее экспортированный XML файл

Теперь открыты все Nodes серверного контроллера. Поскольку стоит задача учебного характера, требуется немного — просто считать 4 переменных блока OKPumpsAuto.

Для этого я создаю Readlist и перетаскиваю интересные мне переменные из правой части экрана в левую. Разумеется, в боевых задачах список чтения может быть больше. Разумеется, в боевых задачах будет не только чтение, но и запись переменных. В этой заметке ограничился одним чтением. В итоге у нас получается следующее:

Итого у нас создан один интерфейс, состоящий из одного списка чтения. Набор данных для чтения подготовлен. Но чего-то не хватает, необходимо еще настроить само соединение интерфейса. Для этого открываем вкладку Properties в нижней части экрана

Необходимо прописать ip-адрес сервера, в моей случае 192.168.43.10.

На странице Security выбираем ранее созданный клиентский сертификат и пока ничего более не меняем.

Создание и заполнение клиентского интерфейса привело к автоматическому созданию двух блоков данных: Client interface_1_Data и Client interface_1_Configuration.

Смотрим блок данных Data, там уже указаны те переменные, которые планируем читать. Удобно!

Теперь необходимо написать программу, которая будет устанавливать связь с OPC UA сервером, готовить канал связи, читать информацию и закрывать соединение. Программа носит строго демонстрационный характер, в боевых задачах она должна быть написана по-другому. В онлайн справке на вызываемые блоки находится все необходимая информация. Там же приводится пример на языке SCL, лучше подходящий к промышленному применению, но не такой наглядный, как в моем случае.

В проект добавляются следующие меркерные переменные

Ищем функцию OPC_UA_Connect и перетаскиваем ее в нетворк OB1

Имя экземплярного блока я оставил по умолчанию. Что радует — этот вызов имеет графический конфигуратор, как, например, вызовы S7-связи в TIA Portal’е или вызов PID-регулятора. Этот конфигуратор экономит просто уйму времени, а это не может не радовать.

Остается выбрать только созданный клиентский интерфейс (он один) и обвязать блок вспомогательными переменными.

Для лучшего понимания привожу скриншот из онлайн справки Step 7. Именно в таком порядке необходимо выполнять вызовы (как минимум три) перед тем, как приступить к чтению/записи данных. Любой вызов выполняется по переднему фронту входа Req. Успешное или неуспешное выполнения вызова я фиксирую (не сбрасывая, сброс только ручной) в переменных с именами done или err.

Теперь привожу скриншоты всех нетворков программы уже после того, как я последовательно сделал запрос на выполнение функциональных блоков. Как вы видите бит запроса req у меня выставлен в истину (блок отрабатывается только по переднему фронту), биты успешного исполнения (done) выставлены в истину. Если у вас ни done, ни error не выставляется в истину,а connectionid первого вызова остается равным нулю, значит, что-то сделано не так. Например, используется не тот Server Endpoint или неправильно установлен сертификат. Эти вызовы должны вызваться последовательно один за другим. Я взводил биты руками и смотрел на результат вызова, а только потом переходил к следующему. Очевидно, что полноценная программа должна осуществлять вызов автоматически и переходить на следующий шаг в зависимости от результата текущего.

Нетворк 4 — самый важный, это цепочка чтения данных с сервера. Ради него все и делалось. Остальные нетворки вызывают функциональные блоки закрытия соединения и освобождения ресурсов. Их я пока не вызывал.

В результате вызова нетворка 4 в блоке данных DB2 появились прочитанные данные:

В настоящий момент два контроллера общаются по протоколу OPC UA, цель почти достигнута. Но не полностью. Настройки безопасности до сих пор находятся на уровне «бери, чо хошь». Я спокойно могу подключиться программой OPC UA Client и читать/записывать все возможные данные. Давайте ограничим круг общения этих ПЛК, пусть они «дружат» только друг с другом. Переходим на серверный контроллер, свойства CPU, OPC UA → Server → Security → Secure channel, убираем из Endpoint’ов политику «No Security»

Проматываем ниже до Trusted Clients. Добавляем сертификат контроллера-клиента (PLC_2). Снимаем галочку Automatically accept client certificates during runtime. Сервер теперь не будет общаться ни с кем, кроме как с клиентским PLC.

Переходим на User authentication, запрещаем гостевой доступ, создаем логин/пароль для пользовательского доступа: user1 / password1.

Прогружаем серверный PLC. Возвращаемся к клиентскому PLC, открываем Client interface, закладка Configuration, выбираем Security, в поле General выставляем режим и политику безопасности:

Проматываем ниже, выбираем тип аутентификации — пользователь и пароль, указываем имя пользователя user1, пароль password1

Снимаем галочку Automatically accept server certificate during runtime

Жмем на зеленую стрелочку, сразу переходим на другую закладку настроек ищем там поле «сертификаты партнерских устройств» и добавляем в него сертификат сервера.

Компилируем и прогружаем клиентский ПЛК (PLC_2), открываем мониторинг OB1 и последовательно вручную исполняем блоки в нетворках 1..4 Если все сделано правильно, то все блоки отработают успешно, а данные будут успешно прочитаны в DB2.

Осталось лишь проверить, пустит ли кого-нибудь еще серверный контроллер. Запускаем OPC UA Client и пробуем подключиться. Список Endpoint’ов возвращается. Подключаемся по Basic256 SignAndEncrypt, указав имя пользователя user1 и пароль password1.

Предлагается проверка сертификата сервера, принимаем его

Но соединение не устанавливается, сервер не принимает сертификат «левого» клиента.

Итого, поставленная цель достигнута!
Настроен безопасный обмен данными M2M.

Автор: Александр Кузнецов

https://vk.com/@akcount-organizuem-shifrovannyi-obmen-mezhdu-dvumya-kontrollerami-s7  

Эта статья на Дзен https://my-sertif.ru/profile/editor/id/5d0cd52d70a11800afed36e2/5d0cd55e2e1e1b00af6ca108/edit

Полезные материалы:

1. Creating of OPC UA clients with .NET and helper class

https://support.industry.siemens.com/cs/document/109737901/creating-of-opc-ua-clients-with-net-and-helper-class?dti=0&pnid=13716&lc=en-RU

2. OPC UA Client Library

https://support.industry.siemens.com/cs/document/109748892/opc-ua-client-library?dti=0&pnid=13716&lc=en-RU

3. On-line справка Step 7 Professional V15.1

4. SIMATIC S7-1500, ET 200MP, ET 200SP, ET 200AL, ET 200pro Communication. Function Manual (10/2021 A5E03735815-AG)

This primitive targeted to construct various diagrams, including graphs/trends showing ongoing process and the archive data. Following types of the diagrams are implemented:

  • “Graph” — builds a graph of the values of a parameter in time
  • “Spectrum” — builds the frequency spectrum of values of a parameter. Window of the data of frequency spectrum is formed on the basis of the size of the widget horizontally, in pixels, and the available data of the parameters imposed on the horizontal grid size. In this regard, the minimum frequency is determined by the value of the attribute “tSize” — “1/tSize“, and maximum frequency of allocated frequencies is determined by half-width of the graph in pixels multiplied by the minimum frequency “width/(2*tSize)“.
  • “XY” — builds the two-dimensional graph of values of a parameter, by pairs to one graphic, where paired by axis Y (0,2,4…) and unpaired by axis X (1,3,5…). Sets time of the data range uses for values of the parameter obtain by axis X and Y, with follow sorting by the axis X and the imaging.

For all the diagram types possible as the data source sets:

Supported tracing of the current values and the values from the archive, and also the possibility of building the graphs of the parameters which have no archive of values, by the current values accumulation into the diagram buffer and only at the diagram active visibility moment.


The process of access to the archive data is optimized, by means of an intermediate buffer for the display, as well as the package of traffic data in the query, by way the data lead to quality enough for display.

Table. A list of additional properties/attributes of the primitive “Diagram”

IdNameNumberValue
backColor Background:color 20

Background color. Color name in form “{color}[-{alpha}]“, where:

Examples:

backImg Background:image 21

Background image. The image name in form “[{src}:]{name}“, where:

Examples:

bordWidth Border:width 22 Border width.
bordColor Border:color 23 Border color (detailed in attribute 20).
bordStyle Border:style 24 Border style: “None”, “Dotted”, “Dashed”, “Solid”, “Double”, “Groove”, “Ridge”, “Inset”, “Outset”.
trcPer Tracing period (s) 25 Mode and frequency of the tracing.
type Type 26 Diagram type: “Trend”, “Spectrum”, “XY”.
General attributes for all the types
tSek Time:seconds 27 Current time, seconds.
tUSek Time:microseconds 28 Current time, microseconds.
tSize Size, seconds 29 Size of the trend, seconds.
curSek Cursor:seconds 30 Cursor position, seconds.
curUSek Cursor:usek 31 Cursor position, microseconds.
curColor Cursor:color 32 Cursor color.
sclColor Scale:color 33 Color of the scale/grid (detailed in attribute 20).
sclHor Scale:horizontal 34 Horizontal mode of the scale/grid: “No draw”, “Grid”, “Markers”, “Grid and markers”, “Grid (log)”, “Markers (log)”, “Grid and markers (log)”.
sclHorScl Scale:horizontal scale (%) 44 Graphics’s horizontal scale in percents, excluding for type “XY”.
sclHorSclOff Scale:horizontal scale offset (%) 45 Offset of graphics’s horizontal scale in percents, excluding for type “XY”.
sclVer Scale:vertical 35 Vertical mode of the scale/grid: “No draw”, “Grid”, “Markers”, “Grid and markers”, “Grid (log)”, “Markers (log)”, “Grid and markers (log)”.
sclVerScl Scale:vertical scale (%) 40 Graphics’s vertical scale in percents.
sclVerSclOff Scale:vertical scale offset (%) 41 Offset of graphics’s vertical scale in percents.
sclMarkColor Scale:Markers:color 36 Color of the markers of the scale/grid (detailed in attribute 20).
sclMarkFont Scale:Markers:font 37

Font of the markers of scale/grid. Font name form “{family} {size} {bold} {italic} {underline} {strike}“, where:

Examples:

valArch Value archiver 38 Value archiver in form “{ArchMod}.{ArchivatorId}“.
valsForPix Values for pixel 42 The number of values per pixel. Increase to enhance the accuracy of export at large time intervals.
parNum Parameters number 39 The number of parameters that can be displayed on the one trend.
Attributes for type: “Graph”
sclHorPer Scale:horizontal grid size, seconds 43 Fixed a grid period of horizontal scale, disable automatic calculation for the grid period. Activated if the periods number into overall size more for two and one period size more for 15 pixels.
Individual attributes of the parameters of trend/graph/XY
prm{X}addr Parameter {X} :address 50 10*{X}

Full address to DAQ attribute of a parameter X or to an archive.
Also supported direct data set by the prefixes:

Example:

0 3.14
1 3.141
5 3.1415</d>” — data for 10 seconds and period 1 second from “25.05.2021 10:00:00”; at pass “tm” and “tm_grnd” it will sets values from the diagram range, and also by set attribute “s” it will allows the time set into seconds; “aprox” — approximate the throughout from one point to other instead the substitution previous value into all the periodical points (typically it is from packing);

prm{X}bordL Parametr {X}:view border:lower 50 10*{X} 1 Lower limit of the parameter X.
prm{X}bordU Parametr {X}:view border:upper 50 10*{X} 2 Upper limit of the parameter X.
prm{X}color Parametr {X}:color 50 10*{X} 3 Color for display of the trend of the parameter X (detailed in attribute 20).
prm{X}width Parametr {X}:width 50 10*{X} 6 Line width for display of the trend of the parameter X, in pixels.
prm{X}scl Parametr {X}:scale 50 10*{X} 5 Separated vertical scale mode of the parameter X: “Global”, “Markers”, “Grid and markers”, “Markers (log)”, “Grid and markers (log)”.
prm{X}val Parametr {X}:value 50 10*{X} 4 Value of the parameter X under the cursor.
prm{X}prop Parametr {X}:properties 50 10*{X} 7 Real archive properties in form “{BegArh}:{EndArh}:{DataPeriod}“, where “BegArh”, “EndArh”, “DataPeriod” — begin, end and period of archive’s data in seconds, real up to microseconds (1e-6).
Оцените статью
Мой сертификат
Добавить комментарий