From OpenSCADAWiki
Jump to: navigation, search
Other languages:
English • ‎українська
Name Version License Source Languages Author Description
Main library 2.0 GPLv2 OscadaLibs.db (SQL, GZip) > DAQ.tmplb_base en, uk, ru Roman Savochenko Library of the main templates of the DAQ sources processing and related services.
  • Founded: 2006

The library was created to provide main templates of the DAQ-sources processing and related services.

The template's names and their parameters are available in languages: English, Ukrainian and Russian. Their source code wrote in human language independent mode with calls for the translations by function tr() and the message's translation also allowed for English, Ukrainian and Russian.

For connection the library to a project of the OpenSCADA station you can obtain the database file as:

  • supplied with a ready and proper package of the Linux distribution like to "openscada-libdb-main", "openscada-LibDB.Main";
  • directly taken for most actual one from the subversion repository and converted to the DB SQLite file in the way:
$ 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.

For the DAQ-templates at generic you need create a device representing object into the Logical Level module and select proper template from the templates library. Next, to correct configuration, follow to specific of the template into the individual description.

1 Templates of standard structures of the DAQ-parameters

1.1 Analog signal (unified) (anUnif)

2.1 GPLv2 * en, uk, ru Roman Savochenko
Result and the operative setup.

Common, representative and unified template of analog input signals processing. The template forms a structure of analog parameter (complex tag) which can be easily connected to most widgets and cadres of the main elements library of the user interface just pointing the parameter object.

The representative structure of analog parameters (complex tags) is:

  • "Variable (var)" — end variable of the parameter — engineeric real value, allowed and suitable for archiving.
  • "Error (err)" — obligatory attribute of any parameter, consist of the combination of the error code and short text description, like to "2:No data or connection with source". The template reserves next error codes:
    • 1, 2 — hardware errors, when the data mostly wrong;
    • 3, 4 — alarm border errors;
    • 5, 6 — warning border errors;
    • 7 — the speed error of the variable changing.
  • "Violations suppress (alSup) and delay (alDelay)" — violations generic control for suppressing and delaying.
  • "Scale: minimum (min)" and "Scale: maximum (max)" — main scale of the end variable, the output of which causes a hardware border error. The scale is also used as a scale of the variable trend display on the graphs.
  • "Logarithmic scale (log)" — the scale sign of the variable trend display on the graphs in the logarithmic scale.
  • "Dimension (ed)" — dimension (unit of measurement) of the variable.
  • "Precision (prec)" — number signs after the dot, for positive values, and precision (signs in whole), for negative ones, to display the real end variable on the screen.

Functions

  • Generic processing of the raw analog input for:
  • simple correction-calibration at the formula "in = iMult*(in+iAdd)";
  • scaling from the hardware border [plcMin...plcMax] to the main border [min...max], applying the square scale scSqr;
At.png The hardware borders can be inverted ones and disabled in whole for equal values of the maximum and minimum, when the main border only used.
  • permission to exceed the border for the input value on the value of plcExcess percent;
  • filtering the input value changing in the time Tf.
  • Simple imitation of the analog input, setting plcImit and linking the imitation-simulation source in plcImitIn.
At.png Missing the link plcImitIn (EVAL) causes to generating random analog input
  • Complex preprocessing and complete generation-imitation of the analog input on the internal programming language of OpenSCADA into the configuration IO inProc, where you can operate next service parameters:
  • in [IN|OUT] — the same raw analog input IO;
  • var [IN] — the end variable IO;
  • min, max [IN] — the main border IOs;
  • plcMin, plcMax [IN] — the hardware border IOs;
  • plcImit, plcImitIn [IN] — IOs of the simple imitation;
  • levErr, tErr [IN|OUT] — alarm level [-7...0] and text of the error (the attribute "err" format);
  • f_frq [IN] — frequency of calculation, the template IO;
  • this [IN] — reference to the parameter object, what executing the template;
  • ctx [IN] — object of the user context, what saved between the execution cycles.
  • Simple substitution for the variable subVar at the error (not valid) input variable (EVAL) in the modes: "no", "last" and "substitute".
  • Processing the result variable var for violation some borders and criteria, generating the alarms and proper setting the attribute err. The alarm borders can have some hysteresis HystBnd, can be delayed on the time alDelay and can be suppressed setting alSup. Next borders and criteria are provided:
  • missing for data or connection with source at the EVAL input value — error code 1 and alarm level 5;
  • exceeding the input value of the hardware border — error code 1,2 and alarm level 5;
  • exceeding the end variable of the alarm border [aMin...aMax] — error code 3,4 and alarm level 4;
At.png Disabled at setting for equal or inverted values of the border
  • exceeding the end variable of the warning border [wMin...wMax] — error code 5,6 and alarm level 2;
At.png Disabled at setting for equal or inverted values of the border
  • big motion speed of the end variable — error code 7 and alarm level 2.

Template IOs

Identifier Name Type Mode Attribute Configuration Value
in Input Real Input Not attribute Link Input|var
inProc Input processing procedure Text Input Not attribute Constant
var Variable Real Input Read only Variable 0
ed Dimension String Input Full access Variable
min Scale: minimum Real Input Full access Variable 0
max Scale: maximum Real Input Full access Variable 100
scSqr Scale: square Boolean Input Full access Variable 0
subMode Substitute: mode Integer numbers selection Input Full access Variable 0

0;1;2
no;last;substitute

subVar Substitute: variable Real Input Full access Variable 0
alSup Violations suppress Boolean Input Full access Variable
alDelay Violations delay, seconds Real Input Full access Variable 0
aMin Border down alarm Real Input Full access Variable 0
aMax Border up alarm Real Input Full access Variable 0
wMin Border down warning Real Input Full access Variable 0
wMax Border up warning Real Input Full access Variable 0
HystBnd Hysteresis of borders violation Real Input Full access Variable 1
speed Motion speed, %/cycle Real Input Full access Variable 0
prec Precision, signs Integer Input Full access Variable 2
log Logarithmic scale Boolean Input Full access Variable 0
Tf Filter time, seconds Real Input Full access Variable 0
iAdd Input addition Real Input Not attribute Constant 0
iMult Input multiplication Real Input Not attribute Constant 1
plcMin Minimum module scale Real Input Not attribute Constant 0
plcMax Maximum module scale Real Input Not attribute Constant 0
plcExcess Allowed scale exceeding, % Real Input Not attribute Constant 0
plcImit PLC imitation Boolean Input Not attribute Constant 0
plcImitIn PLC imitation input Real Input Not attribute Link Imitation|var
this Object Object Output Not attribute Variable
SHIFR Code String Input Not attribute Variable
NAME Name String Input Not attribute Variable
DESCR Description String 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
Configuration.

Configuring and using

1. Create and start a logical controller object or use any presented one with the needed scheduling properties.
2. Create a logical parameter object and select this template for it. Enable the parameter.
3. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Inputlink to a source of the "raw" signal.
  • Input processing procedure — form for the complex preprocessing and complete generation of the analog input on the internal programming language of OpenSCADA. It is optional and should be defined in complex cases, for example:
  • simple and transparent preprocessing to bring the percentage of UPS load to power that can be done with iMult also:
in = 490*in/100;	//the UPS has 480W 
  • implementing of the input signal counter — consumed electricity of the UPS:
//Checking for the data validity
if(ctx.cntr.isEVal())	ctx.cntr = this.var.get();
if(!in.isEVal()) {
	pUPS = 33;
	if(ctx.cntr.isEVal())	ctx.cntr = (pUPS+in)/(3600*f_frq);
	else ctx.cntr += (pUPS+in)/(3600*f_frq);
}

//Checking for the next month reset
month = 0; SYS.localtime(SYS.time(), 0, 0, 0, 0, month);
if(!ctx.month.isEVal() && month != ctx.month)	ctx.cntr = 0;
ctx.month = month;

in = ctx.cntr; 
  • generating of the extended violations — processing for the external signals related to the source:
gO = this.cntr().prm_grps;
if(SYS.DAQ.JavaLikeCalc.lib_aviary.sensorError(gO.prm_generic.PRG_Input_Err_T_room_S.get(),levErr,tErr));
else if(!(tVl=gO.prm_alarms.PRG_Alarm_T_max.get()).isEVal() && tVl)
	levErr = -4, tErr = "11:above the set limit";
else if(!(tVl=gO.prm_alarms.PRG_Alarm_T_min.get()).isEVal() && tVl)
	levErr = -4, tErr = "11:below the set limit"; 
  • Minimum and maximum of the module scale — must be set at the case of significant difference the hardware and the generic scales, for example:
  • the input is raw and measured in value of the current [4...20]mA, here it is necessary to specify 4 and 20 mA;
  • the previous case where it is necessary to simply and transparently calibrate the end value — with a precision device set 4mA and 20mA and indicate here the real measured values of the "raw" signal.
  • Input addition and multiplication — use for easy and linear correction of the input, for example:
  • calibration for the end value, which is less transparent and these coefficients should be calculated according to the formulas:
iAdd = ((plcMin*precMeasMax)/plcMax - precMeasMin)*(plcMax/(plcMax-plcMin))
iMult = (plcMax - plcMin) / (precMeasMax - precMeasMin)
  • Allowed scale exceeding — set if necessary to exceed the value of the main border, and when this scale starts to perform the recommendation function, say for the initial display of the trend on this scale.
  • PLC imitation and the imitation input — define at the need to simulate the input as required in the functions.
4. RESULT: Launching the controller object (where this parameter is created) and if it has not been started, we must get the operational data in the tab "Attributes" for: variable, error status; and the generation of violations if the state of the error is nonzero.
5. In process of the working, through the tab "Attributes" of operational data, in addition to obtaining the result, it is possible to perform operative setup and control on:
  • Scale: minimum and maximum — strictly At.png set to the range of data changes by availability and according to the hardware border, otherwise the value will be distorted! In the absence of the hardware border, this, the main border, is arbitrary and advisory, although exceeding of the border by the value will be also accompanied by a violation.
  • Scale: square — set if the hardware border is square one.
  • Filter time — set the filtering time for noisy signals.
  • Substitute: mode and variable — set the desired substitution mode at invalidity the variable.
  • Violations suppress — set at the need of the parameter violations complete suppression — to disable their generation in whole.
  • Violations delay — set the delay time for the generation of the violations, to exclude frequent generation, characteristic to uncertain sources of data, characterized by short-term loss of communication.
  • Border up/down alarm/warning — set when it is necessary to generate violations at the exceeding of the alarm/warning borders.
  • Hysteresis of borders violation — set the hysteresis of removing the violation, that is, removal of the violations occurs at the specified percentage later, in order to prevent the frequent generation by fluctuating the value near the border.
  • Motion speed — set if it is necessary to warn about fast change of value.
  • Name, Description, Dimension, Precision, Logarithmic scale — set this information as needed when displayed, or as an element of the passport.


1.2 Analog signal (unified, violation statuses) (anUnifSt)

1.2 GPLv2 * en, uk, ru Roman Savochenko

Common, representative and unified template of analog input signals processing, extended by binary states of indication the violations. The template grounded on the base template "Analog signal (unified)" with its representative structure and some differences characteristic to independent development and expansion.

Binary states were provided for the convenient use of algorithms of operation at the borders of violations of the parameter object, preferably in the block diagrams of general control algorithms.

Functions
Mostly the same as the basic template "Analog signal (unified)" and the borderline signs are additionally provided: "H", "L", "HH", "LL", "EVAL".

Template IOs

Identifier Name Type Mode Attribute Configuration Value
Template IOs of "Analog signal (unified)"
H Border up warning violation Boolean Output Read only Variable
L Border down warning violation Boolean Output Read only Variable
HH Border up alarm violation Boolean Output Read only Variable
LL Border down alarm violation Boolean Output Read only Variable
EVAL Error value Boolean Output Read only Variable

Configuring and using
Completely identical to "Analog signal (unified)]" with the difference of using the borderline signs: "H", "L", "HH", "LL", "EVAL"; which can be connected to external computing.


1.3 Manual input (unified) (manInUnif)

1.2 GPLv2 * en, uk, ru Roman Savochenko
Result and the operative setup.

Common, representative and unified template of a manual input and an analog output signal. The template forms a structure of parameter (complex tag) of the manual input what can be easily connected to most widgets and cadres of the main elements library of the user interface just pointing the parameter object, the control mostly can be performed through the Element cadre control panel.

The representative structure of the parameter (complex tag) of the manual input is:

  • "Variable (var)" — end variable of the parameter — engineeric real value, allowed and suitable for archiving.
  • "Variable input (varIn)" — attribute for entering a new engineering value, which in the next falls into the variable.
  • "Error (err)" — obligatory attribute of any parameter, consist of the combination of the error code and short text description, like to "2:No data or connection with source". The template reserves next error codes:
    • 1, 2 — hardware errors, when the data mostly wrong;
    • 3, 4 — alarm border errors;
    • 5, 6 — warning border errors;
    • 7 — the speed error of the variable changing.
  • "Violations suppress (alSup) and delay (alDelay)" — violations generic control for suppressing and delaying.
  • "Scale: minimum (min)" and "Scale: maximum (max)" — main scale of the end variable, the output of which causes a hardware border error. The scale is also used as a scale of the variable trend display on the graphs.
  • "Logarithmic scale (log)" — the scale sign of the variable trend display on the graphs in the logarithmic scale.
  • "Dimension (ed)" — dimension (unit of measurement) of the variable.
  • "Precision (prec)" — number signs after the dot, for positive values, and precision (signs in whole), for negative ones, to display the real end variable on the screen.

Functions

  • Generic processing of the raw analog input for:
  • simple correction-calibration at the formula "in = iMult*(in+iAdd)";
  • scaling from the hardware border [plcMin...plcMax] to the main border [min...max], applying the square scale scSqr;
At.png The hardware borders can be inverted ones and disabled in whole for equal values of the maximum and minimum, when the main border only used.
  • permission to exceed the border for the input value on the value of plcExcess percent;
  • filtering the input value changing in the time Tf.
  • Processing the result variable var for violation some borders and criteria, generating the alarms and proper setting the attribute err. The alarm borders can have some hysteresis HystBnd, can be delayed on the time alDelay and can be suppressed setting alSup. Next borders and criteria are provided:
  • missing for data or connection with source at the EVAL input value — error code 1 and alarm level 5;
  • exceeding the input value of the hardware border — error code 1,2 and alarm level 5;
  • exceeding the end variable of the alarm border [aMin...aMax] — error code 3,4 and alarm level 4;
At.png Disabled at setting for equal or inverted values of the border
  • exceeding the end variable of the warning border [wMin...wMax] — error code 5,6 and alarm level 2;
At.png Disabled at setting for equal or inverted values of the border
  • big motion speed of the end variable — error code 7 and alarm level 2.
  • Reverse conversion of the engineered variable value and writing to the output.
At.png In the absence of the "Input/Output" connection, the writing is not performed and there is the stand-alone operation.

Template IOs

Identifier Name Type Mode Attribute Configuration Value
inout Input/Output Real Output Not attribute Link Parameter|var
var Variable Real Input Read only Variable 0
varIn Variable input Real Input Full access Variable 0
ed Dimension String Input Full access Variable
min Scale: minimum Real Input Full access Variable 0
max Scale: maximum Real Input Full access Variable 100
scSqr Scale: square Boolean Input Full access Variable 0
alSup Violations suppress Boolean Input Full access Variable
alDelay Violations delay, seconds Real Input Full access Variable
aMin Border down alarm Real Input Full access Variable 0
aMax Border up alarm Real Input Full access Variable 0
wMin Border down warning Real Input Full access Variable 0
wMax Border up warning Real Input Full access Variable 0
HystBnd Hysteresis of borders violation Real Input Full access Variable 1
speed Motion speed, %/cycle Real Input Full access Variable 0
prec Precision, signs Integer Input Full access Variable 2
log Logarithmic scale Boolean Input Full access Variable 0
Tf Filter time, seconds Real Input Full access Variable 0
iAdd Input addition Real Input Not attribute Constant 0
iMult Input multiplication Real Input Not attribute Constant 1
plcMin Minimum module scale Real Input Not attribute Constant 0
plcMax Maximum module scale Real Input Not attribute Constant 0
plcExcess Allowed scale exceeding, % Real Input Not attribute Constant 0
this Object Object Output Not attribute Variable
SHIFR Code String Input Not attribute Variable
NAME Name String Input Not attribute Variable
DESCR Description String 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
Configuration.

Configuring and using

1. Create and start a logical controller object or use any presented one with the needed scheduling properties.
2. Create a logical parameter object and select this template for it. Enable the parameter.
3. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Input/Outputlink to a source of the "raw" IO signal, or do not link for the stand-alone mode.
  • Minimum and maximum of the module scale — must be set at the case of significant difference the hardware and the generic scales, for example see the template "Analog signal (unified)".
  • Input addition and multiplication — use for easy and linear correction of the input, for example see the template "Analog signal (unified)".
  • Allowed scale exceeding — set if necessary to exceed the value of the main border, and when this scale starts to perform the recommendation function, say for the initial display of the trend on this scale.
4. RESULT: Launching the controller object (where this parameter is created) and if it has not been started, we must get the operational data in the tab "Attributes" for: variable, error status; and the generation of violations if the state of the error is nonzero; and it will be allowed to set new values.
5. In process of the working, through the tab "Attributes" of operational data, in addition to obtaining the result, it is possible to perform operative setup and control on:
  • Scale: minimum and maximum — strictly At.png set to the range of data changes by availability and according to the hardware border, otherwise the value will be distorted! In the absence of the hardware border, this, the main border, is arbitrary and advisory, although exceeding of the border by the value will be also accompanied by a violation.
  • Scale: square — set if the hardware border is square one.
  • Filter time — set the filtering time for noisy signals.
  • Violations suppress — set at the need of the parameter violations complete suppression — to disable their generation in whole.
  • Violations delay — set the delay time for the generation of the violations, to exclude frequent generation, characteristic to uncertain sources of data, characterized by short-term loss of communication.
  • Border up/down alarm/warning — set when it is necessary to generate violations at the exceeding of the alarm/warning borders.
  • Hysteresis of borders violation — set the hysteresis of removing the violation, that is, removal of the violations occurs at the specified percentage later, in order to prevent the frequent generation by fluctuating the value near the border.
  • Motion speed — set if it is necessary to warn about fast change of value.
  • Name, Description, Dimension, Precision, Logarithmic scale — set this information as needed when displayed, or as an element of the passport.


1.4 Discrete block (unified) (digitBlockUnif)

1.0 GPLv2 * en, uk, ru Roman Savochenko
Result and the operative setup.

Common, representative and unified template of the block for union of Discrete parameters for the common control device. The template forms a structure of discrete parameter-block (complex tag) which can be easily connected to most widgets and cadres of the main elements library of the user interface just pointing the parameter object.

The representative structure of discrete parameters (complex tags) is a latch object with two characteristic states and three commands, which in the final representation may have a different meaning and name:

  • "State "Opened" (st_open)" — the state "Opened" of the latch. Is the primary status signal that can be used without the next one, when 1 (true) is "Opened", and 0 (false) is 'Closed'.
  • "State "Closed" (st_close)" — the state "Closed".
  • "Command "Open" (com)" — the command "Open" of the latch. Is the primary command signal that can be used without the next one, when 1 (true) is "Open", and 0 (false) is 'Close'.
  • "Command "Close" (close)" — the command "Close" of the latch.
  • "Command "Stop" (stop)" — the command "Stop" of the latch.

Functions

  • Direct obtaining, by link, of the two states (read only) and three commands (reading and writing).
  • Possibility of holding the commands for a certain time and removing them.
  • Ability to redefine the states and commands by the appropriate settings of the interface elements, such as digStts, for statuses, and digComs, for commands.

Template IOs

Identifier Name Type Mode Attribute Configuration Value
com Command "Open" Boolean Output Full access Link com
close Command "Close" Boolean Output Full access Link close
stop Command "Stop" Boolean Output Full access Link stop
st_open State "Opened" Boolean Input Read only Link st_open
st_close State "Closed" Boolean Input Read only Link st_close
tCmd Time to hold the command, seconds Integer Input Not attribute Constant 5
last_cmd Last command Integer Output Not attribute Variable 0
w_tm Process command counter Real Output Not attribute Variable 0
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
Configuration.

Configuring and using

1. Create and start a logical controller object or use any presented one with the needed scheduling properties.
2. Create a logical parameter object and select this template for it. Enable the parameter.
3. Into the tab "Template configuration" of the logical parameter object you need to set:
4. RESULT: Launching the controller object (where this parameter is created) and if it has not been started, we must get the operational data in the tab "Attributes" for: states and commands.
5. In process of the working, through the tab "Attributes" of operational data, in addition to obtaining the result, it is possible to perform operative control, performing the commands:


1.5 Alarm discrete (digAlarm)

1.1 GPLv2 * en, uk, ru Roman Savochenko
Result and the operative setup.

Common, representative and unified template of separate discrete parameter (complex tag) processing with formation of signaling by the defined criterion. The template forms a structure of discrete parameter (complex tag) which can be easily connected to most widgets and cadres of the main elements library of the user interface just pointing the parameter object.

The template provides some fields of the representative structure of the discrete parameters and adds the error field:

  • "State "Opened" (st_open)" — the state "Opened".
  • "State "Closed" (st_close)" — the state "Closed".
  • "Error (err)" — obligatory attribute of any parameter, consist of the combination of the error code and short text description, like to "2:No data or connection with source". The template reserves next error codes:
    • 1 — hardware errors, when the data mostly wrong;
    • 3 — violation of the specified condition.
  • "Violations suppress (alSup) and delay (alDelay)" — violations generic control for suppressing and delaying.

Functions

  • Direct obtaining, by link, of the initial state and formation of two representative states with the possibility of their inversion stInv.
  • Complex preprocessing and complete generation-imitation of the discrete input on the internal programming language of OpenSCADA into the configuration IO inProc, where you can operate next service parameters:
  • in [IN|OUT] — the same raw discrete input IO;
  • levErr, tErr [IN|OUT] — alarm level [-7...0] and text of the error (the attribute "err" format);
  • f_frq [IN] — frequency of calculation, the template IO;
  • this [IN] — reference to the parameter object, what executing the template;
  • ctx [IN] — object of the user context, what saved between the execution cycles.
  • Processing of the discrete input in for the purpose of creating a violation and correspondingly setting the attribute err, at the condition "{st}:{lev}:{mess}", that is generation violation of the level lev and the text mess for the input status st (0|1). What can be delayed on the time alDelay and can be suppressed setting alSup.

Template IOs

Identifier Name Type Mode Attribute Configuration Value
alrm Alarm "{st}:{lev}:{mess}" String Input Not attribute Constant
stInv State inversion Boolean Input Not attribute Constant
in Input Boolean Input Read only Link Input|in
inProc Input processing procedure Text Input Not attribute Constant
alSup Violations suppress Boolean Input Full access Variable
alDelay Violations delay, seconds Real Input Full access Variable 0
st_open State "Opened" Boolean Input Read only Variable
st_close State "Closed" Boolean Input Read only Variable
SHIFR Code String Input Not attribute Variable
NAME Name String Input Not attribute Variable
DESCR Description String Input Not attribute Variable
this 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
Configuration.

Configuring and using

1. Create and start a logical controller object or use any presented one with the needed scheduling properties.
2. Create a logical parameter object and select this template for it. Enable the parameter.
3. Into the tab "Template configuration" of the logical parameter object you need to set:
  • "Alarm "{st}:{lev}:{mess}" — define the criterion for the violation formation, leave blank to disable the violations generation.
  • "State inversion" — set to invert the representative attributes, that is, "st_open" set for "in" equal to false.
  • Inputlink to a source of the "raw" signal.
  • Input processing procedure — form for the complex preprocessing and complete generation of the discrete input on the internal programming language of OpenSCADA. For example:
  • complete creation for a complex status:
gO = this.cntr().prm_grps;
status = gO.prm_generic.PRG_Input_Err_T_Zone1_S.get();
in = gO.prm_generic.SET_CalcFan_UseSensor_T1.get() || !(status == 0 || status == 2 || status == 3); 
4. RESULT: Launching the controller object (where this parameter is created) and if it has not been started, we must get the operational data in the tab "Attributes" for: variable, error status; and the generation of violations if the state of the error is nonzero.


1.6 Code state (codeState)

1.2 GPLv2 * en, uk, ru Roman Savochenko
Result and the operative setup.

A variant of the common, representative and unified template of the block for union of Discrete parameters, expanded by more than two states and three commands that can be encoded by an integer value. The template forms a structure of parameter (complex tag) which can be easily connected to most widgets and cadres of the main elements library of the user interface just pointing the parameter object.

The representative structure of the parameter (complex tag) of the code state is:

  • "State "Text" (st_text)" — text description of the state.
  • "Command "Text" (com_text)" — text of the command.
  • "Commands (digComs)" — common list of the allowed commands, to form the selecting.
  • "Error (err)" — obligatory attribute of any parameter, consist of the combination of the error code and short text description, like to "2:No data or connection with source". The template reserves next error codes:
    • 1 — hardware errors, when the data mostly wrong.
  • "Violations suppress (alSup) and delay (alDelay)" — violations generic control for suppressing and delaying.

Functions

  • Direct receiving, by link, the status code and the command (read only), as well as setting the status text according to the list of states stats.
  • Working out the text of the command com_text to find it in the general list coms of commands and issuing the received command code to the output.
  • Generating from the general list coms of commands the list of commands to be selected in digComs.
  • Complex processing and complete generation-imitation of the code state, as well as processing the code or the command text for targeted actions, on the internal programming language of OpenSCADA into the configuration IO inProc, where you can operate next service parameters:
  • in [IN|OUT] — IO of the code state;
  • text [OUT] — direct text status setting;
  • coms [IN] — list of available commands, of the corresponded IO;
  • com_text [IN|OUT] — text of the received command;
  • levErr, tErr [IN|OUT] — alarm level [-7...0] and text of the error (the attribute "err" format);
  • f_frq [IN] — frequency of the calculation, the template IO;
  • this [IN] — reference to the parameter object, what executing the template;
  • ctx [IN] — object of the user context, what saved between the execution cycles.
  • Formation of the violation and the corresponding setting of the attribute err, provided at setting in the processing procedure or lack of the communication (in = EVAL). What can be delayed on the time alDelay and can be suppressed setting alSup.

Template IOs

Identifier Name Type Mode Attribute Configuration Value
in Input Integer Input Read only Link Signal|in
out Output Integer Output Read only Link Signal|out
inProc Input processing procedure Text Input Not attribute Constant
alSup Violations suppress Boolean Input Full access Variable
alDelay Violations delay, seconds Real Input Full access Variable 0
st_text State "Text" String Input Read only Variable
stats States, rows "{code}:{State}" Text Input Full access Variable
com_text Command "Text" String Input Full access Variable
coms Commands-states, rows "{code}:{State}" Text Input Full access Variable
digComs Commands Text Input Read only Variable
SHIFR Code String Input Not attribute Variable
NAME Name String Input Not attribute Variable
DESCR Description String Input Not attribute Variable
this Object Object Output 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
Configuration.

Configuring and using

1. Create and start a logical controller object or use any presented one with the needed scheduling properties.
2. Create a logical parameter object and select this template for it. Enable the parameter.
3. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Input and Outputlink to a source of the "raw" signal.
  • Input processing procedure — form for the processing and complete generation-imitation of the input, and issuing of the specific output, on the internal programming language of OpenSCADA. For example:
  • complete creation for the state code and alarms forming:
gO = this.cntr().prm_grps;
if(gO.prm_fansControl.PRG_CntrFan_AutoMode_G1.get().isEVal())	in = 4;
else {
  if(!(tVl=gO.prm_fansControl.PRG_CntrFan_Alarm_ThermalRelay.get()).isEVal() && tVl)
    levErr = -4, tErr = "11:alarm";
  if(gO.prm_fansControl.PRG_CntrFan_AutoMode_G1.get())
    in = gO.prm_fansControl.PRG_CntrFan_On_G1.get() ? 1 : 2;
  else in = 3;
} 
  • forming the clock time text and issuing the time synchronization — direct status text setting and issuing for specific commands:
curTm = SYS.time();
text = SYS.strftime(curTm, "%H։%M %d.%m.%Y");
gO = this.cntr().prm_grps;
if(!(tVl=gO.prm_other.PRG_RTC_UNIX.get()).isEVal()) {
  text += " ("+(tVl-curTm).toString(10,0,true)+")";
}

if(com_text.length && !com_text.isEVal() && (tVl=coms.match("^([^:]+):"+com_text,"m")).length && tVl[1] == 1) {
  gO.prm_other.SET_RTC_New_UNIX.set(curTm);
  gO.prm_other.KEY_RTC_set_time.set(true);
} 
4. RESULT: Launching the controller object (where this parameter is created) and if it has not been started, we must get the operational data in the tab "Attributes" for: input, output, code-input state, error status; and the generation of violations if the state of the error is nonzero.
5. In process of the working, through the tab "Attributes" of operational data, in addition to obtaining the result, it is possible to perform operative control, performing the commands:
  • States — set to list of accordance with its status code to text.
  • Commands-states — set to list of accordance with its status-command code to text.
  • Command "Text" — set in the command text, which is described in the command list, for the code conversion and issuance.
  • Violations suppress — set at the need of the parameter violations complete suppression — to disable their generation in whole.
  • Violations delay — set the delay time for the generation of the violations, to exclude frequent generation, characteristic to uncertain sources of data, characterized by short-term loss of communication.


1.7 PID signal (unified, violation statuses) (pidUnif)

1.2 GPLv2 * en, uk, ru Roman Savochenko
Result and the operative setup.

Common, representative and unified template of an interface to the Proportional Integral Differential (PID) regulator based on the common analog input signal, extended by binary states of indication the violations. The template forms a structure of the analog PID-regulator which can be easily connected to some cadres and widgets of the main elements library of the user interface just pointing the parameter object.

The representative structure of the analog PID-regulators is:

  • "Variable (var)" — end variable of the parameter — engineeric real value, allowed and suitable for archiving.
  • "Error (err)" — obligatory attribute of any parameter, consist of the combination of the error code and short text description, like to "2:No data or connection with source". The template reserves next error codes:
    • 1, 2 — hardware errors, when the data mostly wrong;
    • 3, 4 — alarm border errors;
    • 5, 6 — warning border errors;
    • 7 — the speed error of the variable changing.
  • "Violations suppress (alSup) and delay (alDelay)" — violations generic control for suppressing and delaying.
  • "Setpoint (sp)" — setpoint for the analog signal value achievement in the automatic mode.
  • "Manual input (manIn)" — attribute for entering a new output value, which in the next falls into the output at the manual mode.
  • "Output (out)" — output (control signal) of the PID-regulator.
  • "Mode: automate (auto)" — the PID-regulator mode "Automatic".
  • "Mode: cascade (casc)" — the PID-regulator mode "Cascade".
  • "Scale: minimum (min)" and "Scale: maximum (max)" — main scale of the end variable, the output of which causes a hardware border error. The scale is also used as a scale of the variable trend display on the graphs.
  • "Logarithmic scale (log)" — the scale sign of the variable trend display on the graphs in the logarithmic scale.
  • "Dimension (ed)" — dimension (unit of measurement) of the variable.
  • "Precision (prec)" — number signs after the dot, for positive values, and precision (signs in whole), for negative ones, to display the real end variable on the screen.

Functions

  • Generic processing of the raw analog input for:
  • simple correction-calibration at the formula "in = iMult*(in+iAdd)";
  • scaling from the hardware border [plcMin...plcMax] to the main border [min...max], applying the square scale scSqr;
  • permission to exceed the border for the input value on the value of plcExcess percent;
  • filtering the input value changing in the time Tf.
  • Simple imitation of the analog input, setting plcImit and linking the imitation-simulation source in plcImitIn.
  • Processing the result variable var for violation some borders and criteria, generating the alarms and proper setting the attribute err. The alarm borders can have some hysteresis HystBnd, can be delayed on the time alDelay and can be suppressed setting alSup. Next borders and criteria are provided:
  • missing for data or connection with source at the EVAL input value — error code 1 and alarm level 5;
  • exceeding the input value of the hardware border — error code 1,2 and alarm level 5;
  • exceeding the end variable of the alarm border [aMin...aMax] — error code 3,4 and alarm level 4;
At.png Disabled at setting for equal or inverted values of the border
  • exceeding the end variable of the warning border [wMin...wMax] — error code 5,6 and alarm level 2;
At.png Disabled at setting for equal or inverted values of the border
  • big motion speed of the end variable — error code 7 and alarm level 2.
  • Transmission of the PID-specific information, control and coefficient attributes to and from the PLC or other data source with the regulation.

Template IOs

Identifier Name Type Mode Attribute Configuration Value
in Input Real Input Not attribute Link Signal|in
sp Setpoint Real Input Full access Link PID|sp
var Variable Real Input Read only Variable 0
manIn Manual input, % Real Input Full access Link PID|manIn
out Output, % Real Input Full access Link PID|out
auto Mode: automate Boolean Input Full access Link PID|auto
casc Mode: cascade Boolean Input Full access Link PID|casc
ed Dimension String Input Full access Variable
min Scale: minimum Real Input Full access Link PID|min
max Scale: maximum Real Input Full access Link PID|max
scSqr Scale: square Boolean Input Full access Variable 0
alSup Violations suppress Boolean Input Full access Variable 0
alDelay Violations delay, seconds Real Input Full access Variable 0
aMin Border down alarm Real Input Full access Variable 0
aMax Border up alarm Real Input Full access Variable 0
wMin Border down warning Real Input Full access Variable 0
wMax Border up warning Real Input Full access Variable 0
HystBnd Hysteresis of borders violation Real Input Full access Variable 0
speed Motion speed, %/cycle Real Input Full access Variable 0
prec Precision, signs Integer Input Full access Variable 2
log Logarithmic scale Boolean Input Full access Variable 0
H Border up warning violation Boolean Output Read only Variable 0
L Border down warning violation Boolean Output Read only Variable 0
HH Border up alarm violation Boolean Output Read only Variable 0
LL Border down alarm violation Boolean Output Read only Variable 0
EVAL Value is error Boolean Output Read only Variable 0
Tf Filter time, milliseconds Real Input Full access Variable 0
Kp Gain Real Input Full access Link PID|Kp
Ti Ti, milliseconds Integer Input Full access Link PID|Ti
Kd Gain differential Real Input Full access Link PID|Kd
Td Td, milliseconds Integer Input Full access Link PID|Td
Tzd T differential lag, milliseconds Integer Input Full access Link PID|Tzd
Zi Insensitivity, % Real Input Full access Link PID|Zi
Hup Upper output border, % Real Input Full access Link PID|Hup
Hdwn Lower output border, % Real Input Full access Link PID|Hdwn
K1 Coefficient of input 1 Real Input Full access Link PID|K1
K2 Coefficient of input 2 Real Input Full access Link PID|K2
K3 Coefficient of input 3 Real Input Full access Link PID|K3
K4 Coefficient of input 4 Real Input Full access Link PID|K4
iAdd Input addition Real Input Not attribute Constant 0
iMult Input multiplication Real Input Not attribute Constant 1
plcMin Minimum module scale Real Input Not attribute Constant 1
plcMax Maximum module scale Real Input Not attribute Constant 5
plcExcess Allowed scale exceeding, % Real Input Not attribute Constant 0
plcImit PLC imitation Boolean Input Not attribute Constant 0
plcImitIn PLC imitation input Real Input Not attribute Link Imitation|var
this Object Object Output Not attribute Variable
SHIFR Code String Input Not attribute Variable
NAME Name String Input Not attribute Variable
DESCR Description String Input Not attribute Variable
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_err Function error String Input Not attribute Variable 0
f_stop Function stop flag Boolean Input Not attribute Variable 0
Configuration.

Configuring and using

1. Create and start a logical controller object or use any presented one with the needed scheduling properties.
2. Create a logical parameter object and select this template for it. Enable the parameter.
3. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Inputlink to a source of the "raw" analog signal.
  • Setpoint, Manual input, Output, Mode: automate, Mode: cascade, Scale: minimum, Scale: maximum, Gain, Ti, Gain differential, Td, T differential lag, Insensitivity, Upper output border, Lower output border, Coefficient of input 1, Coefficient of input 2, Coefficient of input 3, Coefficient of input 4link to a source of the PID-regulator.
  • Input addition and multiplication — use for easy and linear correction of the input, for example see the template "Analog signal (unified)".
  • Allowed scale exceeding — set if necessary to exceed the value of the main border, and when this scale starts to perform the recommendation function, say for the initial display of the trend on this scale.
  • PLC imitation and the imitation input — define at the need to simulate the input as required in the functions.
4. RESULT: Launching the controller object (where this parameter is created) and if it has not been started, we must get the operational data in the tab "Attributes" for: variable, error status; and the generation of violations if the state of the error is nonzero. Also we will get all the PID-specific attributes.
5. In process of the working, through the tab "Attributes" of operational data, in addition to obtaining the result, it is possible to perform operative setup and control on:
  • Scale: minimum and maximum — strictly At.png set to the range of data changes by availability and according to the hardware border, otherwise the value will be distorted!
  • Scale: square — set if the hardware border is square one.
  • Filter time — set the filtering time for noisy signals.
  • Violations suppress — set at the need of the parameter violations complete suppression — to disable their generation in whole.
  • Violations delay — set the delay time for the generation of the violations, to exclude frequent generation, characteristic to uncertain sources of data, characterized by short-term loss of communication.
  • Border up/down alarm/warning — set when it is necessary to generate violations at the exceeding of the alarm/warning borders.
  • Hysteresis of borders violation — set the hysteresis of removing the violation, that is, removal of the violations occurs at the specified percentage later, in order to prevent the frequent generation by fluctuating the value near the border.
  • Motion speed — set if it is necessary to warn about fast change of value.
  • Name, Description, Dimension, Precision, Logarithmic scale — set this information as needed when displayed, or as an element of the passport.


1.8 Impulse PID signal (unified, violation statuses) (pidUnifImp)

1.1 GPLv2 * en, uk, ru Roman Savochenko

Common, representative and unified template of an interface to the Proportional Integral Differential (PID) regulator based on the common analog input signal but with the PWM-output, extended by binary states of indication the violations and mostly like to the template PID signal (unified, violation statuses). The template forms a structure of the impulse PID-regulator which can be easily connected to some cadres of the main elements library of the user interface just pointing the parameter object.

The representative structure of the impulse PID-regulators is mostly equal to the template "PID signal (unified, violation statuses)" and contains a number of attributes specific to the pulse output and the attribute of determining the operation of this regulator in the analog mode, that is, this template is even more generalizable:

  • "Impulse output up (impQup)" and "Impulse output down (impQdwn)" — signals of the PWM-output.
  • "Mode: analog (analog)" — a sign of working the regulator in the analog output mode.

Functions
Mostly the same as the basic template "PID signal (unified, violation statuses)" and the impulse-specific attributes are additionally provided: "Impulse output up", "Impulse output down", "Mode: analog", "T impulses period", "T minimal impulse", "Impulse rate factor".

Template IOs

Identifier Name Type Mode Attribute Configuration Value
Template IOs of "PID signal (unified, violation statuses)"
impQup Impulse output up Boolean Input Read only Link PID|impQupTm
impQdwn Impulse output down Boolean Input Read only Link PID|impQdwnTm
analog Mode: analog Boolean Input Read only Link PID|analog
TImpPer T impulses period, milliseconds Integer Input Full access Link PID|TImpPer
TImpMin T minimal impulse, milliseconds Integer Input Full access Link PID|TImpMin
KImpRfact Impulse rate factor Real Input Full access Link PID|KImpRfact

Configuring and using
Mostly the same as the basic template "Analog signal (unified)" with the difference of using the impulse specific output: "Impulse output up", "Impulse output down", "Mode: analog", "T impulses period", "T minimal impulse", "Impulse rate factor".

2 Templates of the complex objects

In some cases where an object is only a part of a common automated system and does not require deep detailing to the level of signals and parameters (complex tag) around them, including without the need for archiving, it is convenient to unify them in one representative object of the data source OpenSCADA with appropriate consolidated view and object control as a set of simple attributes with violation elements. Such consolidation often occurs around specialised data sources, whose access to data is usually implemented through a separate exchanging protocol, but without unifying the transmission of this data to the level of visualisation and signalling by a separate attribute of the object.

In general, the representative structure of a complex object is:

  • "All items (items)" — common object-type attribute where the attributes of a physical object are directly described by object-type attributes in items and with defined descriptive attributes in each
    • id — attribute identifier;
    • descr — text description of the attribute;
    • wr — a sign of the possibility of writing or a list of value variants to their selection, through the symbol ';';
    • alarm — violation code:
      • 0 — no violation — "NORM";
      • 1 — violation level "WARNING";
      • 2 — violation level "ALARM";
    • val — attribute value;
    • set — attribute value to set the attributes accessible to write.
  • "Error (err)" — obligatory attribute of common violation status of the object in general, consist of the combination of the error code and short text description, like to "2:No data or connection with source". The template reserves next error codes:
    • 1 — violation level "WARNING";
    • 2 — violation level "ALARM";
    • 3 — unreliability or lack of data.
  • "Violations suppress (alSup) and delay (alDelay)" — violations generic control for suppressing and delaying.

Generally, it is advisable to create such template (a layer above the physical data source object) above a raw data source that provides this data in attributes and without processing, and this template therefore performs:

  • collection of these attributes of the raw source into items;
  • processing of properties of the attributes;
  • control and transmitting of commands of the values setting;
  • processing of the violation conditions at single attributes and at the object in whole, together with which these violations can be fixed in the table of actual violations, typically by the function alarmSet().

In addition to complex object templates, this object-control mechanism can be implemented by templates for implementing the logical level of data access, such as in IEC60870.

To represent the data of the object-control mechanism, there currently provided the appropriate Object properties frame, which provides these properties as a table-list with illumination of the violations and the possibility to change the selected and accessible to edit row-properties.


2.1 Uninterruptible Power Supply (UPS)

1.3 GPLv2 * en, uk, ru Roman Savochenko
Result and the operative setup.

Data combination of the Uninterruptible Power Supply in a complex object of the attribute "All items". The template designed to use together with the DAQ-module "System" in the part "UPS" and to represent this data by the frame "Object properties" as a complex object with properties, signalling at single borders and writing.

Template IOs

Identifier Parameter Type Mode Attribute Configuration Value
srcAddr Source object's address String Input Not attribute Constant
alSup Violations suppress Boolean Input Full access Variable
alDelay Violations delay, seconds Real Input Full access Variable 0
items All items Object Output Full access Variable
bChL Battery charge low Real Input Full access Variable 20
bChLL Battery charge critical Real Input Full access Variable 5
inVL Input voltage low Real Input Full access Variable 210
inVH Input voltage high Real Input Full access Variable 250
inFLL Input frequency too low Real Input Full access Variable 40
inFL Input frequency low Real Input Full access Variable 45
inFH Input frequency high Real Input Full access Variable 55
inFHH Input frequency too high Real Input Full access Variable 60
loadH Load high Real Input Full access Variable 80
loadHH Load too high Real Input Full access Variable 100
tH Temperature high Real Input Full access Variable 50
tHH Temperature too high Real Input Full access Variable 70
this Object Object Input Not attribute Variable
SHIFR Code String Input Not attribute Variable
NAME Name String Input Not attribute Variable
DESCR Description String Input Not attribute Variable
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
Configuration.

Configuring and using

1. Create a source controller object into the module "System" and set its Identifier like to "SYSData".
2. Create a source parameter object into the previous controller object and set its Identifier like to "UPS".
3. Create and start a logical controller object or use any presented one with the needed scheduling properties.
4. Create a logical parameter object and select the template for it. Enable the parameter.
5. In the tab "Template configuration" of the logical parameter object you need to set:
  • Source object's address — to address of the source UPS parameter object (see to step 1) like to "System.SYSData.UPS".
6. RESULT: When running the controller object (where this parameter was created) and if it was not started, we must obtain, in the parameter attribute items, this object with all the attributes and their properties. In case of some violations, we will get the corresponding information in the attribute of the parameter err, for which you can adjust the attributes of the boundaries of the corresponding violations.
7. Into the visual interfaces developing of the module Vision place the frame "Object properties" to any page and link it to the parameter object, created into step 4.
8. RESULT: Into runtime of the page you get a table with data of the object, notifications about violations into the header and the possibility to set of writable properties.


2.2 Network devices by SNMP (SNMP)

1.1 GPLv2 * en, uk, ru Roman Savochenko
Result and the operative setup.

Data combination of a device, accessible by the protocol SNMP, in a complex object of the attribute "All items". The template designed to use together with the DAQ-module "SNMP" and to represent this data by the frame "Object properties" as a complex object with properties, signalling at single borders and writing. Considering the great specificity and variety of SNMP-accessible devices, this template is actually a billet and an example of creating a template based on it to a corresponding device with a specific to it processing of input properties, forming of violations and write capability.

  • Sponsored by: PAC HARTRON

Template IOs

Identifier Parameter Type Mode Attribute Configuration Value
srcAddr Source object's address String Input Not attribute Constant
manTables Manual tables String Input Not attribute Constant
alSup Violations suppress Boolean Input Full access Variable
alDelay Violations delay, seconds Real Input Full access Variable 0
items All items Object Output Full access Variable
this Object Object Input Not attribute Variable
SHIFR Code String Input Not attribute Variable
NAME Name String Input Not attribute Variable
DESCR Description String Input Not attribute Variable
f_err Function error String Input Not attribute Variable 0
f_start Function start flag Boolean Input 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
Configuration.

Configuring and using

1. Create a source controller object into the module "SNMP" and set its Identifier like to "SYSData".
2. Create a source parameter object into the previous controller object and set its Identifier like to "DEV".
3. Create and start a logical controller object or use any presented one with the needed scheduling properties.
4. Create a logical parameter object and select the template for it. Enable the parameter.
5. In the tab "Template configuration" of the logical parameter object you need to set:
  • Source object's address — to address of the source SNMP device parameter object (see to step 1) like to "SNMP.SYSData.DEV".
  • Manual tables — enter manually some static MIB-variables.
6. RESULT: When running the controller object (where this parameter was created) and if it was not started, we must obtain, in the parameter attribute items, this object with all the attributes and their properties. In case of some violations, we will get the corresponding information in the attribute of the parameter err, for which you can adjust the attributes of the boundaries of the corresponding violations.
7. Into the visual interfaces developing of the module Vision place the frame "Object properties" to any page and link it to the parameter object, created into step 4.
8. RESULT: Into runtime of the page you get a table with data of the object, notifications about violations into the header and the possibility to set of writable properties.

3 Services

3.1 Notificator by SMS, EMail(SMTP) (ntf)

1.0 GPLv2 * => UserProtocol en, uk, ru Roman Savochenko
Result and the operative setup.

The complex template of the notification contains of parts of the dispatcher and the output user protocol of notification by EMail(SMTP) and SMS.

  • Sponsored by: SVItoVYR LTD

THE DISPATCHER can be performed for pointed messages of the message buffer of OpenSCADA and applied on the Logical level or the controller object of the module JavaLikeCalc.

Template IOs

Identifier Name Type Mode Attribute Configuration Value
io UserPrt: Output IO Object Input Not attribute Variable
tr UserPrt: Transport Object Input Not attribute Variable
tmOut Maximum notification timeout, seconds Integer Input Not attribute Constant 5
messLev Messages level, negative for alarms Integer Input Not attribute Constant 1
messCat Messages category, template or regular expression String Input Not attribute Constant al*:*
emailState Email notification current state String Output Read only Variable
emailTrAddr Output transport for SMTP connection, empty for disable String Input Not attribute Constant Sockets.out_SMTP
emailAuth Auth, empty for disable String Input Not attribute Constant user:pass
emailSender Sender String Input Not attribute Constant noreply@oscada.org
emailReceiver Destination receiver address String Input Not attribute Constant test@oscada.org
emailTopic EMail topic String Input Not attribute Constant Notification
emailMess EMail message String Input Not attribute Constant
SMSState SMS notification current state String Output Read only Variable
SMSTrAddr SMS serial transport, empty for disable String Input Not attribute Constant Serial.out_SMS
SMSPin SMS-pin, empty for disable String Input Not attribute Constant 1111
SMSTel SMS destination receiver, tel. number String Input Not attribute Constant +380XXXXXXXXX
SMSTextMd SMS in the text mode, else PDU Boolean Input Not attribute Constant 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_err Function error String Input Not attribute Variable 0
f_stop Function stop flag Boolean Input Not attribute Variable 0
Configuration.

Configuring and using

1. Create a parameter in a controller object of the Logical Level or a controller object in the module DAQ.JavaLikeCalc.
2. Create an output transport of the type "Serial" and set its Identifier like to "SMS", one transport suitable for more receivers.
3. Set for proper address, only for the Serial device. The serial port speed, asynchronous data format and timeouts will adjusted by the function.
4. Create an output transport of the type "Sockets" or "SSL" and set its Identifier like to "SMTP", one transport suitable for more receivers.
5. Set-up for proper address, for Sockets(25) or SSL(465). The transport timeouts will be adjusted by the function.
6. In the tab "Template configuration" you need to set:
  • Maximum notification timeout, seconds.
  • Messages level, negative for alarms.
  • Messages category, template or regular expression.
  • Output transport for SMTP connection, empty for disable.
  • Auth, empty for disable.
  • Sender.
  • Destination receiver address.
  • EMail topic.
  • EMail message.
  • SMS serial transport, empty for disable.
  • SMS-pin, empty for disable.
  • SMS destination receiver, tel. number.
  • SMS in the text mode, else PDU.
7. RESULT: Sending for the pointed messages at SMS or EMail(SMTP).

THE OUTPUT USER PROTOCOL PART "SMS" provides operations with SMS by a GSM-modem connected as serial device. For now, there supported only sending SMS messages to a number of remote cell phone or GSM-modem. For sending there are supported: ECHO disable, PIN check and set, sending in PDU and the Text mode.

Output user protocol's XML-request structure
<cmd pin="1111" tel="+380XXXXXXXXX" text="{0|1}" err="1:Error">{SMSText}</cmd>

cmd — command, for now only "send" allowed;
pin — PIN-code to the SIM-card access;
tel — telephone number of the receiver (remote cell phone or GSM-modem);
text{0,1} — SMS in the text mode, only ASCII;
SMSText — the message text;
err — sets for the request result.

Configuring and using

1. Create an output transport of the type "Serial" and set its Identifier like to "SMS", one transport suitable for more receivers.
2. Set for proper address. The serial port speed, asynchronous data format and timeouts will adjusted by the function.
3. Create of needed user protocol object based on the templates, with Identifier like to "SMS".
4. Place some requesting commands directly into presented or a new internal OpenSCADA-procedure like to:
req = SYS.XMLNode("send"); req.setAttr("ProtIt","SMS").setAttr("pin","1111").setAttr("tel","+380XXXXXXXXX").setText("Notify message");
SYS.Transport.Serial.out_SMS.messIO(req, "UserProtocol");
rez = req.attr("err").toInt() ? req.attr("err") : "OK";
5. RESULT: In the variable rez you will get "OK" if no errors occur and the message successfully transmitted to the receiver.

THE OUTPUT USER PROTOCOL PART "SMTP" provides operations with a SMTP-server for delivering EMails by their sending through TCP-Socket or SSL. For now, there are supported: TCP, SSL, AUTH, topic encoding for UTF-8.

Output user protocol's XML request structure
<send auth="{user}:{pass}" from="{FromAddr}" to="{ToAddr}" topic="{My Topic}" err="1:Error">{MessageText}</send>

topic — topic of the message;
from — sender address;
to — destination address of the receiver;
auth — authenticate user and password;
MessageText — text of the message;
err — sets for the request result.

Configuring and using

1. Create an output transport of the type "Sockets" or "SSL" and set its Identifier like to "SMTP", one transport suitable for more receivers.
2. Set-up for proper address, for Sockets(25) or SSL(465). The transport timeouts will be adjusted by the function.
3. Create of needed user protocol object based on the templates, with Identifier like to "SMTP".
4. Place some requesting commands directly into allowed or a new internal OpenSCADA procedure like to:
req = SYS.XMLNode("send"); req.setAttr("ProtIt","SMTP").setAttr("from","noreply@oscada.org").setAttr("to","oscada@oscada.org").setAttr("topic","My topic").setText("My message");
SYS.Transport.Sockets.out_SMTP.messIO(req, "UserProtocol");
rez = req.attr("err").toInt() ? req.attr("err") : "OK";
5. RESULT: In the variable rez you will get "OK" if no errors occur and the message successfully transmitted to the receiver.


3.2 Initiative connections processing for assigned output transports (initConsAssignTrs)

1.1 GPLv2 * en, uk, ru Roman Savochenko
Result and the operative setup.

The template of processing input initiative connections was created to provide the latest chain of implementation and support for conception of data acquisition in the passive mode and the initiative connection, that is — the control of associative connections, created by the input transport at each connection.

The function of creation associative output transports at connections is currently only supported by the module "Sockets" and for TCP-sockets.

The control of associative transport means:

  • obtaining a list of the associative transports, by the function assTrsList() of the input transports;
  • reading from new transports (opened) of identification information, which currently represents only the source object identifier;
    • search, by the received identifier, the source object and assigning to it of this transport;
    • registering in the attribute "prcTr" of the object type.
  • checking of existing transports for their closure (detachment), for which performed the deregistration in the attribute "prcTr" of the object type and the establishment of the source object in the empty value; disconnected output associated transports are reused by the input one upon receiving a new connection then it is switched on.

The template can control the containers of data source objects, constructed both as DAQ-objects of the controllers and logical level parameters, what representing the data source and having a transport address definition field, and what generally defined by the configuration field "srcObjPath" of the format {CntrAddr}:{TrCntrFldAddr}, where:

  • CntrAddr — container address, for example: "ModBus" — for DAQ-objects of the controllers, "LogicLev.CntrPLC" — for logical level parameters;
  • TrCntrFldAddr — address of the transport control field in the source object, for example — "%2fcntr%2fcfg%2fADDR" for "ModBus"; what can be obtained in a configurator at the history of pointing on the control field in the status line.
  • Sponsored by: BLUE STAR GROUP Ltd

Template IOs

Identifier Name Type Mode Attribute Configuration Value
inTransport Input transport String Input Not attribute Constant InitiateCons
outTrTm Output transport timeouts String Input Not attribute Constant 10:0.1
srcObjPath Source object path String Input Not attribute Constant ModBus:%2fcntr%2fcfg%2fADDR
prcTr Processed transports Object Output Read only Variable
f_err Function error String Input Not attribute Variable 0
f_start Function start flag Boolean Input 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
Configuration.

Configuring and using

1. Create an input transport of receiving the initiative connections of the module "Sockets" with the name like to "InitiateCons".
2. Set the previously created transport to the needed address of opening the input socket and move it to the mode of creating the associative output transports, leaving the protocol field in empty.
3. Provide a container of the data sources to which associative transports must be connected, which can be either a DAQ-module (such as "DAQ.ModBus"), or a logical controller (such as "DAQ.LogicLev.Sources"), or a parameter in it (such as "DAQ.LogicLev.PLC.Sources"), with logical level parameters representing the data source.
4. For this template, create and run a logical controller object or use any available with the required scheduling properties.
5. Create a logical parameter object and select this template for it. Enable the parameter.
6. In the tab "Template configuration" of the logical parameter object you need to set:
  • Input transport — to value of the identifier of the input transport, created in the item 1, like to "InitiateCons;
  • Output transport timeouts — increase the first digit for very slow connections and typical is normal in most situations
  • Source objects path — set according to the item 3, for the first part, and to the control field path, for the second part, for example, and typically for for "ModBus", is — "ModBus:%2fcntr%2fcfg%2fADDR".
6. RESULT: Starting the controller object (where this parameter was created) and if it was not started, we should get, in the attribute prcTr of the parameter for information about the processed and therefore successfully transport-linked data sources. In case of some violations, we will get the corresponding information in the attribute err of the parameter. The absence of a representative object for the received identifier is placed in the protocol of messages.