From OpenSCADAWiki
Jump to: navigation, search
Name Version License Source Languages Author Description
Main user protocol based library 1.8 Free (GPL2 by default) DB SQLite: File:OscadaLibs.db.gz, Most actual SQL en, uk, ru Roman Savochenko
Arsen Zakojan
Constantine (IrmIngeneer)
Library of functions to provide access to device's data and services through network with simply enough protocols like to common services, industrial automation devices, wide resources counters, low-level buses' chips and so on.
  • Founded: January 2010
  • Spaces: UserProtocol, DAQ.tmplb_{DevLib,LowDevLib}
  • Compatibility: OpenSCADA >= 0.9

The user protocol devices library created to provide common templates and related functions for custom access to services and wide range of devices' data, and also for some integration of the data, with simple enough to implement protocols into: the User Protocol module, presented complex protocols (ModBus, OPC_UA, HTTP) or directly on the internal like to Java language.

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 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 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's database 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 the device representing object into module of Logical controller and select proper template from the templates library. Next, to correct configuration, follow to specific of the template into the individual description.

In general the conception of custom accessing to services and the device's data we can imagine like to Figure 1.

Fig.1. Conception of custom accessing to services and device's data.

As you can see from Figure 1 interaction with devices carried out through some transport on which their physically based. Requests to a transport you can send:

For a protocol placing here you need to do and to follow for the shown demands:

  • be the copyright holder or the author of the code and distribute its under any free license, GPL preferred;
  • prepare and store into a separated DB file of SQLite or as a text file for: the parameters (IO) description, the procedure's code wrote and formed in some system way;
  • write a short description and instruction for connect a device by the protocol in way like to the other ones here;
  • write a direct request to the forum topic "OpenSCADA development" for placing the protocol here, include a proving of its ability to work from any OpenSCADA developer or a short demonstration video.

1 List

ID Name Version License Space Languages
Common services
SMS Sending SMS messages to a number of remote cell phone or GSM modem 2.1 GPL2 UserProtocol en
SMTP EMail send through TCP-Socket or SSL 1.1 GPL2 UserProtocol en
UPS Uninterruptible power supply unifying data. 1.2 GPL2 DAQ.tmplb_DevLib en, uk, ru
Industrial automation
TM510x Elemer TM510x 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
SCU750 EDWARDS TURBOMOLECULAR PUMPS 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
SMDP Sycon Multi Drop Protocol 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
TMH Power supply for turbomolecular pumps 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
IT3 Temperature measurement IT-3 1.2 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
IVE-452HS-02 Power supply of beam-electrons evaporator 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
OPTRIS OPTRIS CT/CTL 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
CTR CTR 100, 101 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
IEC60870 IEC-60870 1.0 GPL2 DAQ.tmplb_DevLib en, uk, ru
SSCP Shark Slave Communication Protocol 0.6 GPL2 DAQ.tmplb_DevLib en, uk, ru
DCON Example: DCON - GPL2 UserProtocol en
OWEN Example: OWEN - GPL2 UserProtocol en
Counters of the resources
VKT7 Heat counter computer VKT7 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
m200 Mercury 200 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
m230 Mercury 230 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
Nik2303I Nik2303I 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru
Low level sensors and chips
1W_{DS9097,DS9097} One Wire by {DS9097,DS9097U} 1.1, 1.1 GPL2 DAQ.tmplb_LowDevLib en
PCF8591 I2C: PCF8591 1.0 GPL2 DAQ.tmplb_LowDevLib en
PCF8574 I2C: PCF8574 1.0 GPL2 DAQ.tmplb_LowDevLib en
BMP180 I2C: BMP180 1.0 GPL2 DAQ.tmplb_LowDevLib en
BME280 I2C: BME280 1.0 GPL2 DAQ.tmplb_LowDevLib en
DS3231 I2C: DS3231 1.0 GPL2 DAQ.tmplb_LowDevLib en
AT24CXX I2C: AT24C{32|64} 1.0 GPL2 DAQ.tmplb_LowDevLib en
DHT GPIO: DHT11,22 1.0 GPL2 DAQ.tmplb_LowDevLib en
1602A I2C: 1602A(HD44780) 1.0 GPL2 DAQ.tmplb_LowDevLib en

2 Common services

SMS Sending SMS messages to a number of remote cell phone or GSM modem 2.1 GPL2 UserProtocol en Roman Savochenko

Provides operations with SMS by the GSM-modem connected as a serial device. For now 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, send in PDU and 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 for receiver (remote cell phone or GSM modem);
text{0,1} — SMS in the text mode, only ASCII
SMSText — the message text;
err — sets to result of the request.

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "SMS", one transport suitable for more receivers.
2. Set proper address, only for the Serial device. The serial port speed, asynchronous data format and timeouts will adjusted by the function.
3. 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";
4. Result: Into the variable rez you will get "OK" if no errors occur and the message successfully transmitted to the receiver.
SMTP EMail send through TCP-Socket or SSL 1.1 GPL2 UserProtocol en Roman Savochenko

Provides operations with EMail 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 — message's topic;
from — sender's address;
to — destination address of the receiver;
auth — authenticate user and password;
MessageText — message's text;
err — sets to result of the request.

Using/configuring:

1. Create an output transport of the type "Sockets" or "SSL" and set its ID like to "SMTP", one transport suitable for more receivers.
2. Set proper address, for Sockets(25) or SSL(465). The transport timeouts will adjusted by the function.
3. Place some requesting commands directly into presented 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";
4. Result: Into the variable rez you will get "OK" if no errors occur and the message successfully transmitted to the receiver.
UPS Uninterruptible power supply unifying data. 1.2 GPL2 DAQ.tmplb_DevLib en, uk, ru Roman Savochenko

Uninterruptible power supply unifying data to provide all the data into the single attribute "All items" of the object type for next control as object with the data providing as a table, alarming and allowing to set for writable attributes. The template designed for using with data source of the module "System" as an "UPS" and the widget "Main.objProps" as the data presenter. The template you can use also as an example to create other data unification as the complex object with properties, alarming and writing.
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
srcAddr Source object's address String Input Not attribute Constant
items All items Object Output Full access Variable
this The 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

Using/configuring:

1. Create a source controller object into the module "System" and set its ID like to "SYSData".
2. Create a source parameter object into the previous source controller object and set its ID 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, one for each the devices. Enable the parameter.
5. Into 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: Into the attribute items you will get the object with all attributes and its properties. At some violations into the attribute "err" you will get information about that.
7. Into the visual interfaces developing of the module Vision place the widget "Main.objProps" 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 it is allowing to set of writable properties.

3 Industrial automation

TM510x Elemer TM510x 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Roman Savochenko

Multi-channels thermometer Elemer TM5102 and TM5103 of the firm Elemer.
Output user protocol's XML request structure: <mess addr="1" err="1:Error">{req}</mess>

req — request/respond data;
addr — remote station address (1...254);
err — sets to result of the request.

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport String Input Not attribute Constant tm510x
addr Device address (1...254) Integer Input Not attribute Constant 1
devTp Device type Integer Input Read only Variable
errors Errors String Input Read only Variable
in1 Input 1 Real Input Read only Variable
in2 Input 2 Real Input Read only Variable
in3 Input 3 Real Input Read only Variable
in4 Input 4 Real Input Read only Variable
in5 Input 5 Real Input Read only Variable
in6 Input 6 Real Input Read only Variable
in7 Input 7 Real Input Read only Variable
in8 Input 8 Real Input Read only Variable

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "tm510", one for each the devices' used serial bus.
2. Set proper address and timeouts of the Serial device.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to ID of the transport into step 1.
  • Device address — to logical address of the device on the bus under the transport in step 1.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes.
SCU750 EDWARDS TURBOMOLECULAR PUMPS 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Roman Savochenko

Typical EDWARDS TURBOMOLECULAR PUMPS (http://edwardsvacuum.com) data acquisition by SCU750 Cotrol Unit protocol.
Sponsored: Vasiliy Grigoriev from "Vacuum technologies laboratory (http://e-beam.ru)".
Output user protocol's XML request structure: <mess addr="1" err="1:Error">{req}</mess>

req — request/respond data;
addr — remote station address (<0 — single; >=0 — multi port);
err — sets to result of the request.

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport String Input Not attribute Constant SCU750
addr Device address (-1...255) Integer Input Not attribute Constant 1
perGet Period data getting (s) Real Input Not attribute Constant 10
version Version String Input Read only Variable
snCntrUnit Serial number: Control Unit String Input Read only Variable
snPump Serial number: Pump String Input Read only Variable
cntPumpHour Pump hour counter (minutes) Real Input Read only Variable
cntCntrUnitHour Control unit hour counter (minutes) Real Input Read only Variable
cntStart Start counter Real Input Read only Variable
operMode Pump Operation Mode String Input Read only Variable
errors Errors String Input Read only Variable
events Events String Input Read only Variable
tTMS TMS temperature (°С) Integer Input Read only Variable
tMotor Motor temperature (°С) Integer Input Read only Variable
rotSpeed Rotational speed (HZ) Integer Input Read only Variable
comStart Command: START Boolean Input Full access Variable
comStop Command: STOP Boolean Input Full access Variable
comReset Command: RESET Boolean Input Full access Variable
spSpeed Set point: Speed Integer Input Full access Variable
spTMSt Set point: TMS temperature Integer Input Read only Variable
spSpeedPrev Set point: Speed (previous) Integer Output Not attribute Variable
cnt Counter Integer Output Not attribute Variable
operModes Operation modes Object Output Not attribute Variable

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "SCU750", one for each the devices' used serial bus.
2. Set proper address and timeouts of the Serial device.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to ID of the transport into step 1.
  • Device address — to logical address of the device on the bus under the transport in step 1.
  • Period data getting — to needed acquisition period which more to the real processing by the logical level controller. Commands and some other functions will process immediately.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes. Also you are able to send some commands to the device through the writable attributes.
SMDP Sycon Multi Drop Protocol 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Roman Savochenko

STM devices for resonant frequency measurement for mass of deposited films attached to their surface by Sycon Instruments, Inc. (http://www.sycon.com).
Sponsored: Vasiliy Grigoriev from "Vacuum technologies laboratory (http://e-beam.ru)".
Output user protocol's XML request structure: <mess addr="16" try="1" err="1:Error">{req}</mess>

req — request/respond data;
addr — remote device address [16...254];
try — tries of the request;
err — sets to result of the request.

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport String Input Not attribute Constant SMDP
addr Device address (16...254) Integer Input Not attribute Constant 16
perGet Period data getting (s) Real Input Not attribute Constant 10
version Firmware Version String Input Read only Variable
CfgPrmSSID Configuration parameter session ID Integer Input Read only Variable
Srlno Measurement serial number Integer Input Read only Variable
RawFreq Channel freq. Real Input Read only Variable
GoodFreq Last used, good channel freq. (Hz) Real Input Read only Variable
RawThick Computed raw thickness, from frequency. (A) Real Input Read only Variable
XtalThick Computed material related thickness, can be zeroed. (A) Real Input Read only Variable
XtalThick_F Filtered computed material related thickness, can be zeroed. (A) Real Input Read only Variable
XtalRate Rate, angstroms per second. Real Input Read only Variable
XtalRate_F Rate, angstroms per second, filtered. Real Input Read only Variable
XtalLife XtalLife (%) Real Input Read only Variable
XtalQual Quality level (0-9). Integer Input Read only Variable
XtalQualPeak Highest quality level seen (0-9). Integer Input Read only Variable
XtalStab Stability level (0-9). Integer Input Read only Variable
XtalStabPeak Highest stability level seen (0-9). Integer Input Read only Variable
XtalStat Channel status. String Input Read only Variable
XtalLife_C XtalLife (%). Integer Input Read only Variable
SessId Session ID Integer Input Full access Variable
Fq Xtal start freq. (Hz) Real Input Full access Variable
Fm Xtal min freq. (Hz) Real Input Full access Variable
Density Material density (gm/cc). Real Input Full access Variable
Zratio Material Z ratio. Not scaled or unitized. Real Input Full access Variable
Tooling 1.000 is 100 % tooling (unity). Real Input Full access Variable
RateReq Requested rate (A/S). Real Input Full access Variable
QlvlTrip Quality threshold, if non 0 and exceeded, xtal fail occurs. Integer Input Full access Variable
SlvlTrip Stability threshold, if non 0 and exceeded, xtal fail occurs. Integer Input Full access Variable

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "SMDP", one for each the devices' used serial bus.
2. Set proper address and timeouts of the Serial device.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to ID of the transport into step 1.
  • Device address — to logical address of the device on the bus under the transport in step 1.
  • Period data getting — to needed acquisition period which more to the real processing by the logical level controller. Commands and some other functions will process immediately.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes. Also you are able to send some commands to the device through the writable attributes.
TMH Power supply for turbomolecular pumps 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Roman Savochenko

Power supply for turbomolecular pumps of the firm SHIMADZU, model EI-R04M.
Sponsored: Vasiliy Grigoriev from "Vacuum technologies laboratory (http://e-beam.ru)".
Output user protocol's XML request structure: <mess addr="1" err="1:Error">{req}</mess>

req — request/respond data;
addr — remote station address (1...32);
err — sets to result of the request.

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport String Input Not attribute Constant TMP
addr Device address (-1...255) Integer Input Not attribute Constant 1
perGet Period data getting (s) Real Input Not attribute Constant 10
modelID Model ID String Input Read only Variable
errors Errors String Input Read only Variable
rotSpeed Rotational speed (HZ) Integer Input Read only Variable
I Current (A) Real Input Read only Variable
axle1disb Axle 1 disbalance Integer Input Read only Variable
axle2disb Axle 2 disbalance Integer Input Read only Variable
MP_X1 MP X1 Integer Input Read only Variable
MP_Y1 MP Y1 Integer Input Read only Variable
MP_X2 MP X2 Integer Input Read only Variable
MP_Y2 MP Y2 Integer Input Read only Variable
MP_Z MP Z Integer Input Read only Variable
operMode Operation Mode String Input Read only Variable
comStart Command: START Boolean Input Full access Variable
comStop Command: STOP Boolean Input Full access Variable
comReset Command: RESET Boolean Input Full access Variable
operCntr Operation Control Mode String Input Read only Variable
comInteract Interactive mode Boolean Input Full access Variable
comAutonom Autonomous mode Boolean Input Full access Variable
cnt Counter Integer Output Not attribute Variable
operModes Operation modes Object Output Not attribute Variable

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "TMP", one for each the devices' used serial bus.
2. Set proper address and timeouts of the Serial device.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to ID of the transport into step 1.
  • Device address — to logical address of the device on the bus under the transport in step 1.
  • Period data getting — to needed acquisition period which more to the real processing by the logical level controller. Commands and some other functions will process immediately.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes. Also you are able to send some commands to the device through the writable attributes.
IT3 Temperature measurement IT-3 1.2 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Roman Savochenko

Temperature measurement IT-3 from OmskEtalon.
Sponsored: Vasiliy Grigoriev from "Vacuum technologies laboratory (http://e-beam.ru)".
Output user protocol's XML request structure: <mess addr="1" err="1:Error">{req}</mess>

req — request/respond data;
addr — remote station address (1...32);
err — sets to result of the request.

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport String Input Not attribute Constant IT3
addr Device address Integer Input Not attribute Constant 1
T Temperature Real Input Read only Variable
H Upper border Boolean Input Read only Variable
L Lower border Boolean Input Read only Variable
relSt Relay state Boolean Input Read only Variable

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "IT3", one for each the devices' used serial bus.
2. Set proper address and timeouts of the Serial device, typical it is "{serDevPath}:4800:8N2".
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to ID of the transport into step 1.
  • Device address — to logical address of the device on the bus under the transport in step 1.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes.
IVE-452HS-02 Power supply of beam-electrons evaporator 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Roman Savochenko

Power supply of beam-electrons evaporator of "Plasma Tech" Ltd, from Moskov.
Sponsored: Vasiliy Grigoriev from "Vacuum technologies laboratory (http://e-beam.ru)".
Output user protocol's XML request structure: <mess addr="255" err="1:Error">{req}</mess>

req — request/respond data;
addr — remote station address (0...255);
err — sets to result of the request.

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport String Input Not attribute Constant Sockets.out_IVE
addr Device address Integer Input Not attribute Constant 255
COIA Output current level set-point Integer Output Full access Variable
COUA Output voltage level set-point Integer Output Full access Variable
COPA Output power level set-point Integer Output Full access Variable
DIA Output current Integer Input Read only Variable
DUA Output voltage Integer Input Read only Variable
DPA Output power Integer Input Read only Variable
DFA Electric arcs frequency Integer Input Read only Variable
DAC Electric arcs counter Integer Input Read only Variable
COM_DEW Command: Blocking by SC and XX Boolean Input Full access Variable
COM_OUT Command: Display on UI out block's params Boolean Input Full access Variable
COM_DEP Command: Enable MK Boolean Input Full access Variable
COM_DEL Command: Blocks #1,2 to net Boolean Input Full access Variable
COM_UF Command: Display on UI frequency and current Boolean Input Full access Variable
DKW MUBR of the block overheated Boolean Input Read only Variable
DKZ Short circuits on the block out Boolean Input Read only Variable
DK MK of the block overheated Boolean Input Read only Variable
DE Power and voltage on out present Boolean Input Read only Variable

Using/configuring:

1. Create an output transport of the type "Serial" directly or by the "Sockets" gate, and set its ID like to "Sockets.out_IVE", one for each the devices' used serial bus.
2. Set proper address and timeouts of the Serial device.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to address of the transport into step 1. Tracing for the address changing is supported.
  • Device address — to logical address of the device on the bus under the transport in step 1. Tracing for the address changing is supported.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes. Also you are able to send some commands to the device through the writable attributes.
OPTRIS OPTRIS CT/CTL 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Roman Savochenko

OPTRIS CT/CTL communication interface of "Optris" GmbH, from Berlin.
Sponsored: Vasiliy Grigoriev from "Vacuum technologies laboratory (http://e-beam.ru)".
Output user protocol's XML request structure: <mess addr="1" cs="1" err="1:Error">{req}</mess>

req — request/respond data;
addr — remote station address (0...15);
сs — use control sum for SET commands [0,1];
err — sets to result of the request.

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport String Input Not attribute Constant Serial.out_OPTRIS
addr Device address Integer Input Not attribute Constant 1
Tproc T process Real Input Read only Variable
Thead T head Real Input Read only Variable
Tbox T box Real Input Read only Variable
Tact T act. Real Input Read only Variable
eps IR epsilon Real Input Full access Variable
trans IR transmission Real Input Full access Variable
spIll Spot illumination Logical Input Full access Variable

Using/configuring:

1. Create an output transport of the type "Serial" directly or by the "Sockets" gate, and set its ID like to "Serial.out_OPTRIS", one for each the devices' used serial bus.
2. Set proper address and timeouts of the Serial device.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to address of the transport into step 1. Tracing for the address changing is supported.
  • Device address — to logical address of the device on the bus under the transport in step 1.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes. Also you are able to send some commands to the device through the writable attributes.
CTR CTR 100, 101 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Roman Savochenko

The RS232C Serial Interface permits the communication between the digital Oerlikon Leybold Vacuum CERAVAC, from Köln.
Sponsored: Vasiliy Grigoriev from "Vacuum technologies laboratory (http://e-beam.ru)".
Output user protocol's XML request structure: <mess err="1:Error">{req}</mess>

req — request/respond data;
err — sets to result of the request.

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport String Input Not attribute Constant Serial.out_CTR
press Pressure, Tor Real Output Read only Variable
zeroSet Zero set Logical Input Full access Variable

Using/configuring:

1. Create an output transport of the type "Serial" directly or by the "Sockets" gate, and set its ID like to "Serial.out_CTR", one for each the devices' used serial bus.
2. Set proper address and timeouts of the Serial device.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to address of the transport into step 1. Tracing for the address changing is supported.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes. Also you are able to send some commands to the device through the writable attributes.
IEC60870 IEC-60870 1.0 GPL2 DAQ.tmplb_DevLib en, uk, ru Roman Savochenko

IEC 60870 part 5 is one from the IEC 60870 set of standards which defines systems used for telecontrol (supervisory control and data acquisition) in electrical engineering and power system automation applications. Part 5 provides a communication profile for sending basic telecontrol messages between two systems, which uses permanent directly connected data circuits between the systems. The template implements part 104 (Ethernet transport) for the client and followed services: STARTDT, STOPDT, TESTFR, Ack, C_IC_NA_1, C_CI_NA_1, C_SC_NA_1, M_SP_NA_1, M_ME_NB_1, C_CS_NA_1. To accumulation of the gathered and controlling data used an object into attribute "items" for next the control as the object with the data represent as table, alarming and allowing set the writable attributes. To the data control by attributes at once you can point its into the attribute "itemsSet". Into the template for the first time there used the not requesting mode of an output transport and free attributes creation wile performing.
Sponsored: Ustijancev Michael.
Implementing task: http://oscada.org/en/development/tasks/posts/subsystem_daq/iec_60870_5_acquisition_protocol_implementation
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport String Input Not attribute Constant Sockets.out_IEC60870
addr Address, {addr}.{OA} String Input Not attribute Constant 0.5
tmRetr Retry connection time, s Real Input Not attribute Constant 10
t1 Acknowledge lack timeout, s Real Input Not attribute Constant 1.5
t2 Acknowledge timeout, s Real Input Not attribute Constant 1
t3 Test timeout, s Real Input Not attribute Constant 2
k Maximum unconfirmed Integer Input Not attribute Constant 12
w Maximum no ack Integer Input Not attribute Constant 8
itemsSet Items set by: "ai|di|do:{IOA}[-{EndIOA}]:a[:{NameBase}]" Text Input Full access Variable
items All items Object Output Full access Variable
this Object Object Input Not attribute Variable
f_frq Function calculate frequency (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
f_err Function error String Input Not attribute Variable 0

Using/configuring:

1. Create an output transport of the type "Sockets", set its ID like to "Sockets.out_IEC60870", one for each the device-PLC.
2. Set proper address and timeouts of the Sockets device-PLC.
3. Create and start a logical controller object or use any presented one with the needed scheduling properties. For interaction by IEC-60870-104 you need to set the execution period to no lesser then 100ms.
4. Create a logical parameter object and select the template for that, one for each the devices-PLCs. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to address of the transport into step 1. Tracing for the address changing is supported.
  • Address — data address in format "{addr}.{OA}".
  • Retry connection time — retry connection time in seconds at the connection miss.
  • Acknowledge lack timeout, in seconds.
  • Acknowledge timeout, in seconds.
  • Test timeout, in seconds.
  • Maximum unconfirmed — not used into the client but it is not generate like flows.
  • Maximum no ack — maximum input packages after what the client will send "Ack".
6. Result: The logical parameter object will perform interaction and placing of gathered data to the object "items", creation/placing and checking for commands of the proper attributes, created by the "itemsSet" instruction.
SSCP Shark Slave Communication Protocol 0.6 GPL2 DAQ.tmplb_DevLib en, uk, ru Roman Savochenko

Shark Slave Communication Protocol from EnergoCentrum PLUS, s.r.o.
Sponsored: Costumer Faster CZ (http://faster.cz)
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport of the Ethernet network, Sockets String Input Not attribute Constant SSCP
addr Address [0...255] Integer Input Not attribute Constant 1
user User String Input Not attribute Constant admin
pass Password String Input Not attribute Constant rw
maxDtFrm Maximum data frame size Integer Input Not attribute Constant 2048
listsDir Folder of the list files String Input Not attribute Constant SSCP
verPrt Protocol version Integer Input Read only Variable
maxDtFrmServ Server's maximum data frame size Integer Input Read only Variable
list Variables selected for processing Text Input Full access Variable
this Object Object Input Not attribute Variable

Using/configuring:

1. Create an output transport of the type "Sockets", set its ID like to "SSCP", one for each the device.
2. Set proper address of the Sockets device to IP-address or host address of the remote device in the Ethernet network.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to address of the transport into step 1. Tracing for the address changing is supported.
  • Address — to logical address of the device on the bus under the transport in step 1.
6. Result: The logical parameter object will perform:
  • reading files of lists listsDir for creation and content forming of the attribute "selList" of list of all allowed device's attributes;
  • reading of content of the attribute list of selected device's attributes to dynamic form their representing attributes into the parameter object;
  • reading of the dynamic formed representing attributes;
  • checking for changes and writing of the dynamic formed representing attributes.
DCON Example: DCON - GPL2 UserProtocol en Roman Savochenko

Mostly aimed for example of implementation of the user protocols into OpenSCADA and contains only main functions into the protocol part.
Input user protocol's part: Test implementing only for processing of requests '#' and '@' with fixed reply data.
Using/configuring:

1. Create an input transport of the type "Serial" mostly and set its to any ID.
2. Set proper address and the timeouts to the Serial device.
3. Set the transport protocol to "UserProtocol.DCON".
4. Result: all requests to the input transports will process by the input part of the module.

Output user protocol's XML request structure: <ReqSymb addr="1" err="1:Error">{req}</ReqSymb>

ReqSymb — type symbol of the request into the tag name, like: '#', '@', etc;
req — request/respond data;
addr — remote host address [1...240];
err — sets to result of the request.

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "DCON", one transport suitable for more receivers.
2. Set proper address and timeouts for the Serial device.
3. Place some requesting commands directly into presented or a new internal OpenSCADA procedure like to:
req = SYS.XMLNode("#"); req.setAttr("ProtIt","DCON").setAttr("addr","1");
SYS.Transport.Serial.out_DCON.messIO(req, "UserProtocol");
data = req.attr("err").length ? "" : req.text();
4. Result: Into the variable data you will get the request's data part if no errors occur. The data is values of the analog inputs.
OWEN Example: OWEN - GPL2 UserProtocol en Constantine (IrmIngeneer)
Refactoring: Roman Savochenko

Mostly models of the OWEN devices by the specific protocol.
Output user protocol's XML request structure: <mess addr="1" err="1:Error">{req}</mess> — message tag

req — request/respond data;
addr — remote station address (0...2047);
err — sets to result of the request.

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "OWEN", one transport suitable for more receivers.
2. Set proper address and timeouts for the Serial device.
3. Place some requesting commands directly into presented or a new internal OpenSCADA procedure like to:
req = SYS.XMLNode("mess"); req.setAttr("ProtIt","OWEN").setAttr("addr","1024").setText(SYS.strFromCharCode(0x87,0x84)); //0xB8,0xDF ?
SYS.Transport.Serial.out_SMS.messIO(req, "UserProtocol");
if(!req.attr("err").length) {
  data = req.text();
  //Specific results process
}
4. Result: Into the variable data you will get the request's data part if no errors occur. The data is values of the analog inputs.

4 Counters of the resources

VKT7 Heat counter computer VKT7 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Roman Savochenko

Firm "Teplocom" (http://www.teplocom.spb.ru) computer "VKT-7" for complex heat measurement and counting. The device complex enough to provide more parameters, more history and accessed by a nonlinear Serial-based protocol at low speed. The template implements acquisition for all significant parameters, gets for their history by hours, days and result months. Also you can to append easily enough for processing of the remained parameters.
Sponsored: Vladislav Chubuk
Output user protocol's XML request structure: <mess addr="1" err="1:Error">{req}</mess>

req — request/respond data;
addr — remote station address (0...254);
err — sets for the request result.

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
imit Imitation drift % (0-disable) Real Input Not attribute Constant 0
trAddr Transport String Input Not attribute Constant Transport.Serial.out_VKT7
arhH Archiver: hours String Input Not attribute Constant
arhD Archiver: days String Input Not attribute Constant
arhRes Archiver: results-month String Input Not attribute Constant
maxDayDepth Archiver: maximum depth of reading for not hours archivers, days Integer Input Not attribute Constant 366
lastResTm Last result months read time (s) Integer Output Full access Variable 0
leftResTm Left result months for read from archive Integer Output Read only Variable
lastDTm Last days read time (s) Integer Output Full access Variable 0
leftDTm Left days for read from archive Integer Output Read only Variable
lastHTm Last hours read time (s) Integer Output Full access Variable
leftHTm Left hours for read from archive Integer Output Read only Variable
diffTm Difference time (server-counter), hours Integer Input Read only Variable
firmVer Firmware version Real Input Read only Variable
abonId Subscriber ID String Input Read only Variable
repDay Report day Integer Input Read only Variable
netNum Network number Integer Input Read only Variable
modelImpl Model implementation Integer Input Read only Variable
tTypeM t: dimension String Input Read only Variable
GTypeM G: dimension String Input Read only Variable
VTypeM V: dimension String Input Read only Variable
MTypeM M: dimension String Input Read only Variable
PTypeM P: dimension String Input Read only Variable
QoTypeM Qo: dimension String Input Read only Variable
QntTypeHIM ВНР: dimension String Input Read only Variable
QntTypeM ВОК: dimension String Input Read only Variable
t1_1 t1 (Tв1) Real Input Full access Variable
t2_1 t2 (Tв1) Real Input Full access Variable
t3_1 t3 (Tв1) Real Input Full access Variable
V1_1 V1 (Tв1) Real Input Full access Variable
V2_1 V2 (Tв1) Real Input Full access Variable
V3_1 V3 (Tв1) Real Input Full access Variable
M1_1 M1 (Tв1) Real Input Full access Variable
M2_1 M2 (Tв1) Real Input Full access Variable
M3_1 M3 (Tв1) Real Input Full access Variable
P1_1 P1 (Tв1) Real Input Full access Variable
P2_1 P2 (Tв1) Real Input Full access Variable
Mg_1 Mg (Tв1) Real Input Full access Variable
Qo_1 Qo (Tв1) Real Input Full access Variable
Qg_1 Qg (Tв1) Real Input Full access Variable
dt_1 dt (Tв1) Real Input Full access Variable
BNR_1 ВНР (Tв1) Real Input Full access Variable
BOC_1 ВОС (Tв1) Real Input Full access Variable
G1_1 G1 (Tв1) Real Input Full access Variable
G2_1 G2 (Tв1) Real Input Full access Variable
t1_2 t1 (Tв2) Real Input Full access Variable
t2_2 t2 (Tв2) Real Input Full access Variable
t3_2 t3 (Tв2) Real Input Full access Variable
V1_2 V1 (Tв2) Real Input Full access Variable
V2_2 V2 (Tв2) Real Input Full access Variable
V3_2 V3 (Tв2) Real Input Full access Variable
M1_2 M1 (Tв2) Real Input Full access Variable
M2_2 M2 (Tв2) Real Input Full access Variable
M3_2 M3 (Tв2) Real Input Full access Variable
P1_2 P1 (Tв2) Real Input Full access Variable
P2_2 P2 (Tв2) Real Input Full access Variable
Mg_2 Mg (Tв2) Real Input Full access Variable
Qo_2 Qo (Tв2) Real Input Full access Variable
Qg_2 Qg (Tв2) Real Input Full access Variable
dt_2 dt (Tв2) Real Input Full access Variable
BNR_2 ВНР (Tв2) Real Input Full access Variable
BOC_2 ВОС (Tв2) Real Input Full access Variable
G1_2 G1 (Tв2) Real Input Full access Variable
G2_2 G2 (Tв2) Real Input Full access Variable

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "VKT7", one for each the devices.
2. Set proper address and timeouts of the Serial device.
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 that, one for each the devices. Enable the parameter.
5. Create or use a minutes (current ones) value archivator object (1m, period=60sek.).
6. Create a hours value archivator object (arhH, period=3600sek.), a days value archivator object (arhD, 86400sek.) and a result month value archivator object (arhM, 86400sek.). Set the "Period archiving (sec)" property of the archivators to '0' for disable the data flow from the archive buffer.
7. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Imitation drift % — to '0' for the imitation disable.
  • Transport — to path of the transport into step 1, like to "Transport.Serial.out_VKT7".
  • Archiver: hours — to the hours archiver into step 6, like to "FSArch.arhH".
  • Archiver: days — to the days archiver into step 6, like to "FSArch.arhD".
  • Archiver: results-month — to the result month archiver into step 6, like to "FSArch.arhM".
  • Archiver: maximum depth of reading for not hours archivers, days — to needed depth of not hours archives reading, in days.
8. Into the tab "Archiving" to set archiving for needed attributes by the archivators.
9. Result: The logical parameter object will perform interaction and placing of current gathered data to the parameter attributes and the current archive. Other archives' data will read in parallel from the previously set depth per one value for the period i.e. one day (for the days archive) per the minute period and up to the current and last value.
m200 Mercury 200 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Arsen Zakojan

One phase counter of electricity Mercury 200, 203.2Т, 206 from the firm "Incotex" (http://www.incotexcom.ru)
Output user protocol's XML request structure: <req first="255" second="16777215" data="{req}">{resp}</req>

req — request data;
resp — respond data;
first, second — first and three of second's bytes of the common address (0...4294967295).

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
s Energy from reset, tariffs sum String Input Read only Variable
t1 Energy from reset, tariff 1 Real Input Read only Variable
t2 Energy from reset, tariff 2 Real Input Read only Variable
t3 Energy from reset, tariff 3 Real Input Read only Variable
t4 Energy from reset, tariff 4 Real Input Read only Variable
U Voltage U(V) Real Input Read only Variable
I Current I(A) Real Input Read only Variable
P Power P(W) Real Input Read only Variable
transport Transport String Input Not attribute Constant merc200
netaddr Network address Real Input Not attribute Constant 1
naladchik Coded address by the program Fixer+ Boolean Input Not attribute Constant 0
tarif Read energy from reset Boolean Input Not attribute Constant 1
UIP Read current values Boolean Input Not attribute Constant 1
first First byte of the address Integer Input Not attribute Variable
second Last 3 bytes of the address Integer Input Not attribute Variable
f_stop Function stop flag Boolean Input Not attribute Variable 0
f_err Function error String Input Not attribute Variable 0
f_start Function start flag Boolean Input Not attribute Variable 0
f_frq Function calculate frequency (Hz) Real Input Not attribute Variable 1000

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "merc200", one for each the devices' used serial bus.
2. Set proper address and timeouts of the Serial device.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to ID of the transport into step 1.
  • Network address — to logical address of the device on the bus under the transport in step 1.
  • Coded address by the program Fixer+ — set the flag for counters coded by the program. Most likely the address will equal to apartment number.
  • Read energy from reset — set the flag if you need the data.
  • Read current values — set the flag to read current values.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes.
m230 Mercury 230 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Arsen Zakojan

Three phase counter of electricity Mercury 230, 231, 232, 233, 234, 236 from the firm "Incotex" (http://www.incotexcom.ru)
Output user protocol's XML request structure: <req netaddr="255" data="{req}">{resp}</req>

req — request data;
resp — respond data;
netaddr — network address; for counters Mercury 230, 231 and 233 the tree last digits are serial number or they are last two digits for the number more to 240; if the last numbers are zero, the network address is "1"; universal, broadcast address is "0".

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
answer Answer to the password request String Input Read only Variable
TS Read energy of tariffs sum Boolean Input Not attribute Constant 0
T1 Read energy of tariff 1 Boolean Input Not attribute Constant 0
T2 Read energy of tariff 2 Boolean Input Not attribute Constant 0
T3 Read energy of tariff 3 Boolean Input Not attribute Constant 0
T4 Read energy of tariff 4 Boolean Input Not attribute Constant 0
P Read power P Boolean Input Not attribute Constant 0
Q Read power Q Boolean Input Not attribute Constant 0
S Read power S Boolean Input Not attribute Constant 0
U Read voltage U Boolean Input Not attribute Constant 0
I Read current I Boolean Input Not attribute Constant 0
K Read power coefficient Boolean Input Not attribute Constant 0
F Read frequency F Boolean Input Not attribute Constant 0
N Read serial number Boolean Input Not attribute Constant 0
TSAp Energy from resetting, tariffs sum A+ Real Input Read only Variable
TSAm Energy from resetting, tariffs sum A- Real Input Read only Variable
TSRp Energy from resetting, tariffs sum R+ Real Input Read only Variable
TSRm Energy from resetting, tariffs sum R- Real Input Read only Variable
T1Ap Energy from resetting, tariff 1 A+ Real Input Read only Variable
T1Am Energy from resetting, tariff 1 A- Real Input Read only Variable
T1Rp Energy from resetting, tariff 1 R+ Real Input Read only Variable
T1Rm Energy from resetting, tariff 1 R- Real Input Read only Variable
T2Ap Energy from resetting, tariff 2 A+ Real Input Read only Variable
T2Am Energy from resetting, tariff 2 A- Real Input Read only Variable
T2Rp Energy from resetting, tariff 2 R+ Real Input Read only Variable
T2Rm Energy from resetting, tariff 2 R- Real Input Read only Variable
T3Ap Energy from resetting, tariff 3 A+ Real Input Read only Variable
T3Am Energy from resetting, tariff 3 A- Real Input Read only Variable
T3Rp Energy from resetting, tariff 3 R+ Real Input Read only Variable
T3Rm Energy from resetting, tariff 3 R- Real Input Read only Variable
T4Ap Energy from resetting, tariff 4 A+ Real Input Read only Variable
T4Am Energy from resetting, tariff 4 A- Real Input Read only Variable
T4Rp Energy from resetting, tariff 4 R+ Real Input Read only Variable
T4Rm Energy from resetting, tariff 4 R- Real Input Read only Variable
PS Power P(W) by the phases sum Real Input Read only Variable
P1 Power P(W) by the phase 1 Real Input Read only Variable
P2 Power P(W) by the phase 2 Real Input Read only Variable
P3 Power P(W) by the phase 3 Real Input Read only Variable
QS Power Q(var) by the phases sum Real Input Read only Variable
Q1 Power Q(var) by the phase 1 Real Input Read only Variable
Q2 Power Q(var) by the phase 2 Real Input Read only Variable
Q3 Power Q(var) by the phase 3 Real Input Read only Variable
SS Power S(VA) by the phases sum Real Input Read only Variable
S1 Power S(VA) by the phase 1 Real Input Read only Variable
S2 Power S(VA) by the phase 2 Real Input Read only Variable
S3 Power S(VA) by the phase 3 Real Input Read only Variable
U1 Voltage U(V) by the phase 1 Real Input Read only Variable
U2 Voltage U(V) by the phase 2 Real Input Read only Variable
U3 Voltage U(V) by the phase 3 Real Input Read only Variable
I1 Current I(A) by the phase 1 Real Input Read only Variable
I2 Current I(A) by the phase 2 Real Input Read only Variable
I3 Current I(A) by the phase 3 Real Input Read only Variable
KS Power coefficient by the phases sum Real Input Read only Variable
K1 Power coefficient by the phase 1 Real Input Read only Variable
K2 Power coefficient by the phase 2 Real Input Read only Variable
K3 Power coefficient by the phase 3 Real Input Read only Variable
F1 Frequency F(Hz) Real Input Read only Variable
N1 Serial number String Input Read only Variable
netaddr Network address (0...240) Integer Input Not attribute Constant 1
password Password String Input Not attribute Constant 111111
transport Transport String Input Not attribute Constant merc230
f_stop Function stop flag Boolean Input Not attribute Variable 0
f_err Function error String Input Not attribute Variable 0
f_start Function start flag Boolean Input Not attribute Variable 0
f_frq Function calculate frequency (Hz) Real Input Not attribute Variable 1000

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "merc230", one for each the devices' used serial bus.
2. Set proper address and timeouts of the Serial device.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to ID of the transport into step 1.
  • Network address (0...240) — to logical address of the device on the bus under the transport in step 1.
  • Password — first level password, by default 111111.
  • Set flags for all parameters you need to read.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes.
Nik2303I Nik2303I 1.0 GPL2 DAQ.tmplb_DevLib => UserProtocol en, uk, ru Ruslan Yarmoliuk

Three phase counter of electricity NIK 2303 from firm NIK LLC (http://www.nik.net.ua).
Output user protocol's XML request structure: <req SN="1234567" cntr="0x10">{resp}</req>

SN — serial number of the counter;
cntr — control word;
resp — respond data.

Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport String Input Not attribute Constant Sockets.out_
serial Factory number of the counter String Input Not attribute Constant
passw Password String Input Not attribute Constant 1111111111111111
kT Coefficient of transformation Integer Input Not attribute Constant 1
T0 Current values Boolean Input Not attribute Constant 0
T1 Current values tariff T1 Boolean Input Not attribute Constant 0
T2 Current values tariff T2 Boolean Input Not attribute Constant 0
T3 Current values tariff T3 Boolean Input Not attribute Constant 0
U Instantaneous value "Voltage" Boolean Input Not attribute Constant 0
I Instantaneous value "Current" Boolean Input Not attribute Constant 0
P Instantaneous value "Power" Boolean Input Not attribute Constant 0
kP Instantaneous value "Power coefficient" Boolean Input Not attribute Constant 0
Q Instantaneous value "Power reactive" Boolean Input Not attribute Constant 0
K Instantaneous value "Vectors angle" Boolean Input Not attribute Constant 0
Ae А+(kW*h) Real Output Read only Variable
Ae_ А-(kW*h) Real Output Read only Variable
Re R+(1+2quadrant)(kVar*h) Real Output Read only Variable
Re_ R-(3+4quadrant)(kVar*h) Real Output Read only Variable
Ae1 А1+(kW*h) Real Output Read only Variable
Ae_1 А1-(kW*h) Real Output Read only Variable
Re1 R1+(1+2quadrant)(kVar*h) Real Output Read only Variable
Re_1 R1-(3+4quadrant)(kVar*h) Real Output Read only Variable
Ae2 А2+(kW*h) Real Output Read only Variable
Ae_2 А2-(kW*h) Real Output Read only Variable
Re2 R2+(1+2quadrant)(kVar*h) Real Output Read only Variable
Re_2 R2-(3+4quadrant)(kVar*h) Real Output Read only Variable
Ae3 А3+(kW*h) Real Output Read only Variable
Ae_3 А3-(kW*h) Real Output Read only Variable
Re3 R3+(1+2quadrant)(kVar*h) Real Output Read only Variable
Re_3 R3-(3+4quadrant)(kVar*h) Real Output Read only Variable
U1 Phase voltage 1(V) Real Output Read only Variable
U2 Phase voltage 2(V) Real Output Read only Variable
U3 Phase voltage 3(V) Real Output Read only Variable
I1 Phase current 1(A) Real Output Read only Variable
I2 Phase current 2(A) Real Output Read only Variable
I3 Phase current 3(A) Real Output Read only Variable
kP1 Power coeff. cos φ phase 1 Real Output Read only Variable
kP2 Power coeff. cos φ phase 2 Real Output Read only Variable
kP3 Power coeff. cos φ phase 3 Real Output Read only Variable
Psum Summary active power (kW) Real Output Read only Variable
P1 Active power phase 1 (kW) Real Output Read only Variable
P2 Active power phase 2 (kW) Real Output Read only Variable
P3 Active power phase 3 (kW) Real Output Read only Variable
Qsum Summary reactive power (kVar) Real Output Read only Variable
Q1 Reactive power phase 1 (kVar) Real Output Read only Variable
Q2 Reactive power phase 2 (kVar) Real Output Read only Variable
Q3 Reactive power phase 3 (kVar) Real Output Read only Variable
V12 Vector angle U1_U2 (degr.) Integer Output Read only Variable
V13 Vector angle U1_U3 (degr.) Integer Output Read only Variable
this Object Object Input Not attribute Variable
NAME Name String Input Read only Variable
SHIFR Shifr String Input Read only Variable
DESCR Description String Input Read only Variable
f_stop Function stop flag Boolean Input Not attribute Variable 0
f_err Function error String Input Not attribute Variable 0
f_start Function start flag Boolean Input Not attribute Variable 0
f_frq Function calculate frequency (Hz) Real Input Not attribute Variable 1000

Using/configuring:

1. Create an output transport of the type "Sockets" or "Serial" and set its ID like to "nik2303", one for each the device.
2. Set proper address and timeouts of the Sockets or Serial device.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport — to ID of the transport into step 1.
  • Factory number of the counter — to proper factory number of the counter.
  • Password — first level password, by default 1111111111111111.
  • Coefficient of transformation — at accounting through the current transformers set the coefficient, by default it us — 1.
  • Set flags for all parameters you need to read.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the parameter attributes.

5 Low level sensors and chips

1W_{DS9097,DS9097} One Wire by {DS9097,DS9097U} 1.1, 1.1 GPL2 DAQ.tmplb_LowDevLib en Roman Savochenko

One Wire sensors bus implementing by 1Wire-adapter {DS9097,DS9097U}. Supported direct and parasite powering for the temperature sensors.
Supported 1Wire-devices: DS1820, DS1820/DS18S20/DS1920 (not tested), DS1822 (not tested), DS2413, DS2408, DS2450, DS2438.
Ds9097.png
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport of the One Wire bus, Serial String Input Not attribute Constant oneWire
tmResc Rescan period, s Real Input Not attribute Constant 60
power Power, for temperature Boolean Input Read only Variable
this Object Object Input Not attribute Variable
f_frq Function calculate frequency (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
f_err Function error String Input Not attribute Variable 0

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "oneWire", one for each the One Wire bus.
2. Set proper address of the Serial device, only for the adapter's serial device like "/dev/ttyS{N}". The serial port speed, asynchronous data format and timeouts will adjust by the template.
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 that, one for each the devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • Transport of the One Wire bus, Serial — to the address of the transport into step 1. Tracing for the address changing is supported.
  • Rescan period, s — periodicity of rescaning for new and removed devices search.
6. Result: The logical parameter object will perform at first searching to 1Wire devices on the bus and create included parameters to the each found one. Next the logical parameter object will perform gather data of the found devices and trace to modify of the writable device's properties.
PCF8591 I2C: PCF8591 1.0 GPL2 DAQ.tmplb_LowDevLib en Roman Savochenko

I2C 8-bit 4xA/D and D/A converter. Connects through a Serial output transport into the I2C mode.
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport of the I2C, Serial String Input Not attribute Constant i2c
addr Device address [0...119] Integer Input Not attribute Constant 72
vRef Reference voltage, V Real Input Not attribute Constant 3.2
ai0 AI0 Real Input Read only Variable
ai1 AI1 Real Input Read only Variable
ai2 AI2 Real Input Read only Variable
ai3 AI3 Real Input Read only Variable
ao AO Real Input Full access Variable
f_frq Function calculate frequency (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
f_err Function error String Input Not attribute Variable 0

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "i2c", one for each the I2C bus.
2. Set proper address of the Serial device, only the I2C bus address like "/dev/i2c-{N}". Set the symbol's time into the timeouts field to the minimum value.
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 that, one for each I2C slave devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • transport — to the address of the transport into step 1. Tracing for the address changing is supported.
  • addr — the I2C slave device's address [0...119].
  • vRef — reference voltage of the AIs and AO.
6. Result: The logical parameter object will perform interaction and placing of gathered data to the AI attributes and also will take the AO and write to the chip.
PCF8574 I2C: PCF8574 1.0 GPL2 DAQ.tmplb_LowDevLib en Roman Savochenko

I2C 8-bit 8DIO. Connects through a Serial output transport into the I2C mode.
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport I2C String Input Not attribute Constant i2c
addr Device address (0, 119) Integer Input Not attribute Constant 39
di0 DI0 Boolean Input Read only Variable
di1 DI1 Boolean Input Read only Variable
di2 DI2 Boolean Input Read only Variable
di3 DI3 Boolean Input Read only Variable
di4 DI4 Boolean Input Read only Variable
di5 DI5 Boolean Input Read only Variable
di6 DI6 Boolean Input Read only Variable
di7 DI7 Boolean Input Read only Variable
do0 DO0 Boolean Output Full access Variable
do1 DO1 Boolean Output Full access Variable
do2 DO2 Boolean Output Full access Variable
do3 DO3 Boolean Output Full access Variable
do4 DO4 Boolean Output Full access Variable
do5 DO5 Boolean Output Full access Variable
do6 DO6 Boolean Output Full access Variable
do7 DO7 Boolean Output Full access Variable
f_frq Function calculate frequency (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
f_err Function error String Input Not attribute Variable 0

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "i2c", one for each the I2C bus.
2. Set proper address of the Serial device, only the I2C bus address like "/dev/i2c-{N}". Set the symbol's time into the timeouts field to the minimum value.
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 that, one for each I2C slave devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • transport — to the address of the transport into step 1. Tracing for the address changing is supported.
  • addr — the I2C slave device's address [0...119].
6. Result: The logical parameter object will perform interaction and placing of gathered data to the DI attributes and also will take the DO and write to the chip.
BMP180 I2C: BMP180 1.0 GPL2 DAQ.tmplb_LowDevLib en Roman Savochenko

I2C Pressure and Temperature sensor. Connecting through a Serial output transport into the I2C mode.
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport of the I2C, Serial String Input Not attribute Constant i2c
addr Device address [0...119] Integer Input Not attribute Constant 119
oss Oversampling setting (0...3) Integer Input Not attribute Constant 0
t T, °С Real Input Read only Variable
p P, Pa Real Input Read only Variable
f_frq Function calculate frequency (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
f_err Function error String Input Not attribute Variable 0

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "i2c", one for each the I2C bus.
2. Set proper address of the Serial device, only the I2C bus address like "/dev/i2c-{N}". Set the symbol's time into the timeouts field to the minimum value.
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 that, one for each I2C slave devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • transport — to the address of the transport into step 1. Tracing for the address changing is supported.
  • addr — the I2C slave device's address [0...119].
  • oss — oversampling setting of pressure measurement [0...3].
6. Result: The logical parameter object will perform interaction and placing of gathered data to the Pressure and Temperature attributes.
BME280 I2C: BME280 1.0 GPL2 DAQ.tmplb_LowDevLib en Arcadiy Kisel, Roman Savochenko

I2C Pressure, Temperature and Humidity sensor. Connect through a Serial output transport into the I2C mode.
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport of the I2C, Serial String Input Not attribute Constant i2c
addr Device address [0...119] Integer Input Not attribute Constant 118
oss Oversampling setting (0...7) Integer Input Not attribute Constant 0
t T, °С Real Input Read only Variable
p P, Pa Real Input Read only Variable
h H, % Real Input Read only Variable
f_frq Function calculate frequency (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
f_err Function error String Input Not attribute Variable 0

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "i2c", one for each the I2C bus.
2. Set proper address of the Serial device, only the I2C bus address like "/dev/i2c-{N}". Set the symbol's time into the timeouts field to the minimum value.
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 that, one for each I2C slave devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • transport — to the address of the transport into step 1. Tracing for the address changing is supported.
  • addr — the I2C slave device's address [0...119].
  • oss — oversampling setting of pressure measurement [0...7].
6. Result: The logical parameter object will perform interaction and placing of gathered data to the Pressure, Temperature and Humidity attributes.
DS3231 I2C: DS3231 1.0 GPL2 DAQ.tmplb_LowDevLib en Roman Savochenko

I2C RTC chip with Temperature sensor and calibration on it. Connecting through a Serial output transport into the I2C mode.
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport of the I2C, Serial String Input Not attribute Constant i2c
addr Device address [0...119] Integer Input Not attribute Constant 119
tm Date and time, YYYY-MM-DDTHH:mm:SS String Input Full access Variable
agOff Aging offset, [-128...127] Integer Input Full access Variable
t T, °С Real Input Read only Variable
p32k Enable 32768Hz Boolean Input Full access Variable
pSQW Enable SQUARE-WAVE OUTPUT Boolean Input Full access Variable
pSQWf SQUARE-WAVE OUTPUT frequency: 0-1Hz, 1-1.024kHz, 2-4.096kHz, 3-8.192kHz Integer Input Full access Variable
f_frq Function calculate frequency (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
f_err Function error String Input Not attribute Variable 0

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "i2c", one for each the I2C bus.
2. Set proper address of the Serial device, only the I2C bus address like "/dev/i2c-{N}". Set the symbol's time into the timeouts field to the minimum value.
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 that, one for each I2C slave devices. Enable the parameter.
5. Into the tab "Template configuration" of the logical parameter object you need to set:
  • transport — to the address of the transport into step 1. Tracing for the address changing is supported.
  • addr — the I2C slave device's address [0...119].
6. Result: The logical parameter object will perform interaction and placing of gathered data to the DateTime, Temperature and some one state attributes and also will take the DateTime, some one state attributes and write it to the chip.
AT24CXX I2C: AT24C{32|64} 1.0 GPL2 DAQ.tmplb_LowDevLib en Roman Savochenko

Provides operations with EEPROM memory based on I2C chips AT24C32 (4KB) and AT24C64 (8KB). Supported random reading and writing.
Output user protocol's XML request structure: <{cmd} addr="{ChipAddr}" off="{MemOffset}" size="{ReadSize}" err="1:Error">{ReadWriteSeq}</{cmd}>

cmd — command, for now there allowed: "read", "write";
addr — I2C device address [0...119];
off — memory part offset;
size — read memory block size.
ReadWriteSeq — Read/Write bytes sequence.
err — sets to result of the request.

Using/configuring:

1. Create an output transport of the type "Serial" and set its ID like to "i2c", one for each the I2C bus.
2. Set proper address of the Serial device, only the I2C bus address like "/dev/i2c-{N}". Set the symbol's time into the timeouts field to the minimum value.
3. Place some requesting commands directly into presented or a new internal OpenSCADA procedure like to:
req = SYS.XMLNode("read"); req.setAttr("ProtIt","AT24CXX").setAttr("addr",87).setAttr("off",1000).setAttr("size",20).setText("My message");
req = SYS.XMLNode("write"); req.setAttr("ProtIt","AT24CXX").setAttr("addr",87).setAttr("off",1000).setText("Stored data");
4. Result: Into text() for "read" you will get the read data if no errors occur.
DHT GPIO: DHT11,22 1.0 GPL2 DAQ.tmplb_LowDevLib en Roman Savochenko

Digital Temperature and Humidity Sensor for models: DHT11, DHT12, AM2302, AM2320, ... . The module designed for the sensors connect through GPIO, mostly it's Raspberry PI BCM2835 GPIO.
Conditions: Exclusively realtime planing in the priority 199 (FIFO-99).
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
addr GPIO address with functions mode(), get() and put(), mostly it's BCM2835 String Input Not attribute Constant DAQ.BCM2835.pi.pi
pin IO pin number of the GPIO Integer Input Not attribute Constant 17
tries Tries [1...5] Integer Input Not attribute Constant 2
dev Device (0-DHT11, 1-DHT22) Integer Input Not attribute Constant 1
t T, °С Real Input Read only Variable
h H, % Real Input Read only Variable
f_frq Function calculate frequency (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
f_err Function error String Input Not attribute Variable 0

Using/configuring:

1. Create an output controller and a parameter object into the DAQ module "BCM 2835", by default it's "pi.pi".
2. Create and start a logical controller object or use any presented one with the needed scheduling properties (FIFO-199).
3. Create a logical parameter object and select the template for that, one for each sensor. Enable the parameter.
4. Into the tab "Template configuration" of the logical parameter object you need to set:
  • addr — to the address of the "BCM 2835" parameter like "DAQ.BCM2835.pi.pi"; tracing for the address changing is supported;
  • pin — GPIO pin number where connected the data pin of the sensor;
  • tries — tries of the sensor reading;
  • dev — generic device specific selection.
5. Result: The logical parameter object will perform interaction and placing of gathered data to the Temperature and Humidity attributes.
1602A I2C: 1602A(HD44780) 1.0 GPL2 DAQ.tmplb_LowDevLib en Roman Savochenko

LCD Module 1602A, STN, BLUB, 16 Character x 2 Line, 5 x 8 Dots, by the direct (Raspberry PI BCM2835 GPIO) or I2C (PCF8574) wiring.
Conditions: Default planing policy but realtime one preferred.
Template parameters:

ID Parameter Type Mode Attribute Configuration Value
transport Transport of the I2C, Serial (i2c) or

GPIO address with function put(), mostly it's BCM2835 (DAQ.BCM2835.pi.pi) || String || Input || Not attribute || Constant || i2c

addr I2C device address [0...119] Integer Input Not attribute Constant 39
RS GPIO Pin: Reset Integer Input Not attribute Constant 7
E GPIO Pin: Enable Integer Input Not attribute Constant 8
D4 GPIO Pin: Data4 Integer Input Not attribute Constant 25
D5 GPIO Pin: Data5 Integer Input Not attribute Constant 24
D6 GPIO Pin: Data6 Integer Input Not attribute Constant 23
D7 GPIO Pin: Data7 Integer Input Not attribute Constant 18
ln1 Line 1 String Input Full access Variable
ln2 Line 2 String Input Full access Variable
f_frq Function calculate frequency (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
f_err Function error String Input Not attribute Variable 0

Using/configuring:

1. Create an output controller and an object of parameter in DAQ module "BCM 2835", by default it's "pi.pi" or create an output transport of the type "Serial", set address like to "i2c", one for each the I2C bus.
2. Create and start a logical controller object or use any presented one with the needed scheduling properties.
3. Create a logical parameter object and select the template for that, one for each sensor. Enable the parameter.
4. Into the tab "Template configuration" of the logical parameter object you need to set:
  • transport — to address of the "BCM 2835" parameter like to "DAQ.BCM2835.pi.pi" or to address of the transport into step 1; tracing for the address changing is supported;
  • addr — the I2C slave device's address [0...119];
  • RS, E, D4, D5, D6, D7 — numbers of the GPIO pins where connected the proper data ones of the sensor.
5. Result: The logical parameter object will perform interaction and setting lines' values to the display.