Name | Version | License | Source | Languages | Author | Icon | Description |
---|---|---|---|---|---|---|---|
Prescriptions | 1.1, 1.1 | GPLv2 |
OscadaLibs.db (SQL, GZip) > DAQ.tmplb_PrescrTempl |
en, uk, ru | Roman Savochenko | Library of elements of scenarios of the technological operations — prescriptions.
|
The library is created to provide an environment of execution of scenarios of the technological operations — prescriptions, and frames of the user interface about them, including the frame of creation/edition the prescriptions and two frames of the execution control and reporting — "Prescription — run" and "Prescription — run, simple". The library is built on the basis primitives of the widgets and the internal programming language JavaLikeCalc, including templates and commands.
The element's names and their parameters are available in languages: English, Ukrainian and mRussian. Their source code wrote in human-language independent mode with calls for the translations by the function tr() and the message's translation also allowed for English, Ukrainian and mRussian.
The scenario of technological operations — prescription, is a sequentially call of the function's blocks — commands, which taking up to five arguments and return string with the result code at the begin: "Working (0)", "Finished (>0)" and "Error (<0)". Calling the step command is made in a loop until the "Working (0)" result is returned. Jump to the next step is made in the case of the "Finished (>0)" result and the command "Pass (2)". In the case of an error, the "Error (<0)" result, the prescription execution is terminated.
The commands sequence, by the user of the final interface, are formed on the frame of creation/editing and are controlled for their execution on the frame "Prescription — run" and "Prescription — run, simple", when, the prescriptions data is stored in the programs-prescriptions DB table. The prescriptions-programs table is placed into the accessible OpenSCADA specific configuration database, as an example, currently such table is placed in the library database as "PrescrProgs = (name, prgTxt)", where:
The prescriptions-programs XML-tree starts with the "prg" tag that contains the command end tags "com" with attributes:
For example, for a four-step prescription we will have:
<prg>
<com arg1="10" id="Timer" />
<com arg1="10" id="Vacuum" />
<com arg1="20" id="Timer" />
<com arg1="34" id="Enable coils" />
</prg>
The prescription execution making through the prescription manager's parameter, which support two modes of the prescription commands execution:
The execution mode "command-parameter"
The commands-parameters of the logical level are formed by the programmer of SCADA-system under the specific application area as templates of parameters of the subsystem "Data acquisition", which next used into the logical controller of the prescriptions, include series of mandatory, service and internal attributes:
A specific of using commands-parameters is their independent execution and the ability to leave the execution of a number of commands in the background, such as regulators. These commands can also be directly connected to a data source through links, or even implemented in the same template-parameter.
This mode is now the main one, and it has implemented many mechanisms of interaction with visualization and control frames, which may not work or work erroneously with the old "command-macro" mode!
The execution mode "command-macro" (old)
The commands-macros, which user can choose during the formation of a prescription-program, are formed by the programmer of SCADA-system under the specific application area by editing a commands table in OpenSCADA. The commands table is placed into the accessible OpenSCADA specific configuration database, as an example, currently such table is placed in the library database as "PrescrComs = (name, proc, arg1, arg2, arg3, arg4, arg5)", where:
JavaLikeCalc.JavaScript
if(f_start) tmp1 = arg1;
var curTm = tmp1.toReal();
if(curTm <= 0) { rez = "1:Waiting is elapsed for "+arg1+"s"; return; }
curTm -= 1/f_frq;
tmp1 = max(0, curTm);
rez = "0:Waiting now for "+curTm+"s";
The several command names are reserved for the special purposes:
The section contains DAQ-templates of the prescription manager and commands of the "command-template" mode, which are intended to be connected to the logic level controller, by creating related parameters of the prescription manager and commands, which available for the user to choose from, and which will carry out all the work with the prescriptions-programs for their processing and execution.
For connection the library part to a project of the OpenSCADA station you can obtain the database file as:
wget http://oscada.org/svn/trunk/OpenSCADA/data/LibsDB/OscadaLibs.sql
sqlite3 -init OscadaLibs.sql OscadaLibs.db .exit
This obtained file next you can place into the project directory of the station and create the database object for the DB module "SQLite", registering the database file in the configuration.
2.1 Prescriptions manager (manager) |
2.2 | GPLv2 | * | en, uk, ru | Roman Savochenko |
Basic, representative and unified template of a manager and a controller of the prescriptions, of their processing and direct execution in the "command-macro" mode. The template forms a structure of the prescription manager parameter which can be easily connected to all frames of this library.
The representative structure of the prescription manager is:
Functions
Template IOs
Identifier | Name | Type | Mode | Attribute | Configuration | Value |
---|---|---|---|---|---|---|
dbDB | DB: DB name with the tables | String | Input | Read only | Constant | |
dbComs | DB: Table with commands | String | Input | Not attribute | Constant | PrescrComs |
dbProgs | DB: Table with programs | String | Input | Read only | Constant | PrescrProgs |
comsCntr | Commands controller,
<empty> - for commands into the table, |
String | Input | Not attribute | Constant | * |
mode | Mode | Integer numbers selection | Input | Full access | Variable | -2
-2;-1;0;1;2;3 Finish;Error;Stop;Run;Pause;Pass com |
curMode | Current mode | Integer numbers selection | Input | Read only | Variable | -2
-2;-1;0;1;2;3 Finish;Error;Stop;Run;Pause;Pass com |
prog | Name of the selected program | String | Input | Full access | Variable | |
startTm | Start time, seconds | Integer | Input | Read only | Variable | |
curCom | Current command-step | String | Input | Read only | Variable | |
work | Work program | Object | Input | Read only | Variable | |
comLs | Commands list | Object | Input | Read only | Variable | |
clcCnt | Cycles counter | Integer | Input | Not attribute | Variable | |
this | The object | Object | Input | Not attribute | Variable | |
f_err | Function error | String | Input | Not attribute | Variable | 0 |
f_frq | Frequency of calculation of the function, Hz | Real | Input | Not attribute | Variable | 1000 |
f_start | Function start flag | Boolean | Input | Not attribute | Variable | 0 |
f_stop | Function stop flag | Boolean | Input | Not attribute | Variable | 0 |
Configuring and using
dbDB dbProgs comLs prog mode curMode startTm curCom work
2.2.1 Command — Timer (timer) |
2.0 | GPLv2 | * | en, uk, ru | Roman Savochenko |
Template of a command of the prescription typical timer. The timer is only designed to hold time between other action steps and for example, so it only has one attribute, "Time" in seconds.
Template IOs
Identifier | Name | Type | Mode | Attribute | Configuration | Value |
---|---|---|---|---|---|---|
start | Prescription: start | Boolean | Input | Full access | Variable | 0 |
stop | Prescription: stop | Boolean | Input | Full access | Variable | 0 |
error | Prescription: error | Boolean | Input | Full access | Variable | 0 |
abort | Prescription: abort | Boolean | Input | Full access | Variable | 0 |
run | Command: run | Boolean | Input | Full access | Variable | 0 |
pause | Command: pause | Boolean | Input | Full access | Variable | 0 |
rez | Command: result | String | Input | Full access | Variable | 1 |
arg1 | Time, seconds | Real | Input | Full access | Variable | |
tmp1 | Temporary 1 | Real | Output | Not attribute | Variable | 0 |
f_stop | Function stop flag | Boolean | Input | Not attribute | Variable | 0 |
f_frq | Frequency of calculation of the function, Hz | Real | Input | Not attribute | Variable | 1000 |
f_err | Function error | String | Input | Not attribute | Variable | 0 |
f_start | Function start flag | Boolean | Input | Not attribute | Variable | 0 |
Configuring and using
2.2.2 Command — Background timer (backTimer) |
2.0 | GPLv2 | * | en, uk, ru | Roman Savochenko |
Template of a command of the prescription background timer. The timer designed only for hold a time in the background to an example, then it contains only one attribute, it is "Time" in seconds.
Template IOs
Identifier | Name | Type | Mode | Attribute | Configuration | Value |
---|---|---|---|---|---|---|
start | Prescription: start | Boolean | Input | Full access | Variable | 0 |
stop | Prescription: stop | Boolean | Input | Full access | Variable | 0 |
error | Prescription: error | Boolean | Input | Full access | Variable | 0 |
abort | Prescription: abort | Boolean | Input | Full access | Variable | 0 |
run | Command: run | Boolean | Input | Full access | Variable | 0 |
pause | Command: pause | Boolean | Input | Full access | Variable | 0 |
rez | Command: result | String | Input | Full access | Variable | 1 |
arg1 | Time, seconds | Real | Input | Full access | Variable | |
tmp1 | Temporary 1 | Real | Output | Not attribute | Variable | 0 |
f_stop | Function stop flag | Boolean | Input | Not attribute | Variable | 0 |
f_frq | Frequency of calculation of the function, Hz | Real | Input | Not attribute | Variable | 1000 |
f_err | Function error | String | Input | Not attribute | Variable | 0 |
f_start | Function start flag | Boolean | Input | Not attribute | Variable | 0 |
Configuring and using
Contains elements-frames of the prescription of the end type and elements-widgets, what intended to be placed in the mnemonic schemes part (the type of view) of the project tree of the pages, built on the concept of the signal objects of the root page "RootPgSo" and to be placed on the other complex frames. However, elements-frames may be located as separate entities or as part of your own concept of the page management, but it should be take in account that frames often refer and call certain control panels of the common usage and related elements!
For connection the library part to a project of the OpenSCADA station you can obtain the database file as:
wget http://oscada.org/svn/trunk/OpenSCADA/data/LibsDB/vcaBase.sql
sqlite3 -init vcaBase.sql vcaBase.db .exit
This obtained file next you can place into the project directory of the station and create the database object for the DB module "SQLite", registering the database file in the configuration.
3.1 Prescription — edit (prescrEdit) |
1.3 | GPLv2 | * | en, uk, ru | Roman Savochenko |
The frame, shown in Figure 3.1, is one of the group frames for working with the prescriptions, which serves for the user-editing of the prescriptions-programs. The frame commonly uses and represents the representative structure of the prescription manager.
The frame contains from left to right:
Using — development
The frame is designed to perform the role of page, and should therefore be placed directly in the project's tree. To the frame can be connected one parameter of the prescription manager, by setting the links.
Using — runtime
In the runtime mode, the user can add new prescription-programs, delete, copy and export the existing ones as well as to import prescriptions from other OpenSCADA stations. In the selected prescription-program user can do: add or insert a new step, remove or move the selected step. For the selected steps of the prescription-program the user can set the command and enter the name, description, background execution flag and values for the available arguments of the selected command, and then to save changes of the step.
Removal operations are accompanied by the confirmation dialog.
{Linking and configuring the attributes
Identifier | Name | Type | Configuration | Configuration template |
---|---|---|---|---|
dbDB | DB: Data base | String | Input link | Controller|dbDB |
dbProgs | DB: Programs table | String | Input link | Controller|dbProgs |
prExtComLs | Available commands list | Object | Input link | Controller|comLs |
3.2 Prescription — run (prescrRun) |
1.3 | GPLv2 | * | en, uk, ru | Roman Savochenko |
The frame, shown in Figure 3.2, is one of the group frames for working with the prescriptions, which serves for control and observing of executing the programs-prescriptions, previously formed in the Prescription — edit frame. The frame commonly uses and represents the representative structure of the prescription manager. In addition to this full-format prescription frame, there is a simplified one — "Prescription — run, simple, that allows you to manage and to track compactly the prescriptions execution in other frames of the technological process.
The frame contains from the left to the right:
Using — development
The frame is designed to perform the role of page, and should therefore be placed directly in the project's tree. To the frame can be connected one parameter of the prescription manager, by setting the links.
To archive completed sessions while the operator is switching between frames, this full-format frame in the project tree must be set for the parameter "Page: process not opened".
At the end of the prescription-program, messages with session parameters are generated by the prescription manager, as well as archiving of the session document. The messages with the session parameters can be used either simply to view the sessions history or to create a session list, for example, in the graphics group to go to the history at the session time. The reports archive is set to the depth of 10 documents by default, what you can change by setting the "Archive length (n)" attribute of the document widget.
Using — runtime
In the runtime mode, the user can select the desired prescription-program and run-on the execution, and then track the execution progress or switch to other frames. The running program user can pause by pressing the "Pause" button or terminate by pressing "Stop". In addition, the user can skip the current step by clicking the "Skip" button. Also the user can review or print reports of the previously executed prescriptions of this full-format frame, for what it is necessary to press the left mouse button on the document and browse on the navigation bar through the archive of the executed prescriptions.
{Linking and configuring the attributes
Identifier | Name | Type | Configuration | Configuration template |
---|---|---|---|---|
dbDB | DB: Data base | String | Input link | Controller|dbDB |
dbProgs | DB: Programs table | String | Input link | Controller|dbProgs |
prExtCurCom | Controller: current command | String | Input link | Controller|curCom |
prExtMode | Controller: mode | Integer | Full link | Controller|mode |
prExtProg | Controller: program | String | Full link | Controller|prog |
prExtStartTm | Controller: start time | Integer | Input link | Controller|startTm |
prExtWork | Controller: work | Object | Input link | Controller|work |
3.3 Prescription — run, simple (prescrRunSimple) |
1.3 | GPLv2 | * | en, uk, ru | Roman Savochenko |
The widget, shown in Figure 3.3, is a simple variant of the frame "Prescription — run", which designed for placing as a widget of the mnemonic schemes and it mostly works together the frame "Prescription — run". The frame commonly uses and represents the representative structure of the prescription manager.
The widget contains from the left to the right and to the bottom:
Using — development
This widget can be used by the developer to create mnemonic schemes with displaying the prescriptions execution activity and to fast control them. To use it you need to add this widget to a mnemonic scheme, adjust for the horizontal, vertical size, by scaling, and connect to the prescription manager, by setting the links.
Using — runtime
In the runtime mode, the user can select the desired prescription-program, in the dialog of selecting item into tree that appears at the prescription button click, and run-on the execution, and then track the execution progress or switch to other frames. The running program user can pause by pressing the "Pause" button or terminate by pressing "Stop". In addition, the user can skip the current step by clicking the "Skip" button.
{Linking and configuring the attributes
Identifier | Name | Type | Configuration | Configuration template |
---|---|---|---|---|
dbDB | DB: Data base | String | Input link | Controller|dbDB |
dbProgs | DB: Programs table | String | Input link | Controller|dbProgs |
prExtCurCom | Controller: current command | String | Input link | Controller|curCom |
prExtMode | Controller: mode | Integer | Full link | Controller|mode |
prExtProg | Controller: program | String | Full link | Controller|prog |
prExtStartTm | Controller: start time | Integer | Input link | Controller|startTm |
prExtWork | Controller: work | Object | Input link | Controller|work |
Libs/Prescriptions/en - GFDL | December 2024 | OpenSCADA 1+r3000 |