Name | Version | License | Source | Languages | Author | Description |
---|---|---|---|---|---|---|
Low level sensors and chips library | 1.6 | GPLv2 | OscadaLibs.db (SQL, GZip) > DAQ.tmplb_LowDevLib | en, uk, ru | Roman Savochenko Arcadiy Kisel (2017) |
Library of templates to provide access to device's data of the low-level buses.
|
The user protocol devices library created to provide access to device's data of low-level buses, with protocols simple enough to implement into the User Protocol module or directly on the internal like to Java language.
The template's names and their parameters are available in languages: English, Ukrainian and mRussian. Their source code wrote in the human-language independent mode with calls for the translations by the function tr() and the message's translation also allowed for English, Ukrainian and mRussian.
For connection the library to a project of the OpenSCADA station you can obtain the database file as:
wget http://oscada.org/svn/trunk/OpenSCADA/data/LibsDB/OscadaLibs.sql
sqlite3 -init OscadaLibs.sql OscadaLibs.db .exit
This obtained file next you can place into the project directory of the station and create the database object for the DB module "SQLite", registering the database file in the configuration.
For the DAQ-templates in generic you need to create a representing object of the device into the Logical controller module and to select the proper template from the templates library. Next, to correct configuration, follow to specific of the template into its individual description. The conception of accessing the data by a user protocol we can imagine like to Figure 1.
As you can see from Figure 1, interaction with devices carried out through some transport on which their physically based. Requests to the transport you can send:
Working directly with the output transport of the string messIO(string mess, real timeOut = 0); function does not imply blocking the output transport outside this function call and, therefore, for complex protocols with response packets more than in one packet, which requires the "waiting" process, can not be used a shared transport, at which can be sent packets of different protocols or even one, but for different tasks (controller objects). Therefore, if you need to use shared transport, place the poll parameters in one controller object (task), or use the user protocol module to which this remark is irrelevant, since it performs such blocking at the time of the call of the processing procedure, as well as other modular protocols of OpenSCADA. To place a protocol implementation here you need to do and to follow for the shown demands:
1 BT: RDTech UM24C, UM25C and UM34C (RDTech) |
1.1 | GPLv2 | * | en,uk | Roman Savochenko |
RDTech UM24C/UM25C/UM34C BlueTooth interface template. Tested only on UM24C now.
The RDTech (RuiDeng) UM24C, UM25C and UM34C are low-cost USB pass-through power measurement devices, and support a decent number of collection features, as well as full control via Bluetooth. This template implements most exposed commands and data collection available by the device's Bluetooth interface.
This template in first time uses the new output transports connection function SYS.Transport.outAt() and the Bluetooth interface for the data acquisition.
Template IOs
Identifier | Parameter | Type | Mode | Attribute | Configuration | Value |
---|---|---|---|---|---|---|
transport | Transport | String | Input | Not attribute | Constant | Serial.RD:/dev/rfcomm0:9600||1000:40-20 |
dev | Device to bind
Like to "98:D3:31:F8:52:29" for binding by "rfcomm bind {N} 98:D3:31:F8:52:29". |
String | Input | Not attribute | Constant | |
V | Volts | Real | Input | Read only | Variable | |
A | Amperes | Real | Input | Read only | Variable | |
W | Watts | Real | Input | Read only | Variable | |
T | Temperature, °С | Integer | Input | Read only | Variable | |
R | Resistance, Om | Real | Input | Read only | Variable | |
rec | Recording | Boolean | Input | Read only | Variable | |
recAh | Record, Ah | Real | Input | Read only | Variable | |
recWh | Record, Wh | Real | Input | Read only | Variable | |
recThr | Record threshold, A [0...0.3] | Real | Input | Full access | Variable | |
recTm | Record time, seconds | Real | Input | Read only | Variable | |
grps | Groups | Text | Input | Read only | Variable | |
grpNext | Group next | Boolean | Input | Full access | Variable | |
grpClear | Group clear | Boolean | Input | Full access | Variable | |
chMode | Charging Mode | String | Input | Read only | Variable | |
scr | Screen, [0...6] | Integer | Input | Read only | Variable | |
scrNext | Screen next | Boolean | Input | Full access | Variable | |
scrRot | Screen rotate | Boolean | Input | Full access | Variable | |
scrTm | Screen timeout, minutes [0...9] | Integer | Input | Full access | Variable | |
scrBright | Screen brightness, [0...5] | Integer | Input | Full access | Variable | |
this | Object | Object | Input | Not attribute | Variable | |
f_err | Function error | String | Input | Not attribute | Variable | 0 |
f_stop | Function stop flag | Boolean | Input | Not attribute | Variable | 0 |
f_start | Function start flag | Boolean | Input | Not attribute | Variable | 0 |
f_frq | Frequency of calculation of the function, Hz | Real | Input | Not attribute | Variable | 1000 |
Configuring and using
bluetoothctl
#[bluetooth]# scan on
# Discovery started
# [NEW] Device 98:D3:31:F8:52:29 UM24C
# [CHG] Device 98:D3:31:F8:52:29 RSSI: -60
#[bluetooth]# scan off
#[bluetooth]# pair 98:D3:31:F8:52:29
# Attempting to pair with 98:D3:31:F8:52:29
# [CHG] Device 98:D3:31:F8:52:29 Connected: yes
# Request PIN code
# [UM241m[agent] Enter PIN code: 1234
# Pairing successful
#[bluetooth]# trust 98:D3:31:F8:52:29
# [CHG] Device 98:D3:31:F8:52:29 Trusted: yes
# Changing 98:D3:31:F8:52:29 trust succeeded
#[bluetooth]# exit
rfcomm bind 0 98:D3:31:F8:52:29 # 0 here for binding to /dev/rfcomm0
2 BT: ATORCH UC96 (UC96) |
1.0 | GPLv2 | * | en,uk | Roman Savochenko |
ATORCH UC96 BlueTooth interface template.
The ATORCH UC96 are low-cost USB pass-through power measurement device with many interfaces and supporting a decent number of collection features, as well as control via Bluetooth. This template implements only the clearing data command and data collection by the device's Bluetooth interface.
The device sends data packages not at a request and just after establishing the connection, that is broadcasting with one second period. The device may not to send the data packages at enable not in the first screen, so you need to switch the first screen for the data appearance. The data can be missed also after suspending the PC, so this template in the first time implements the data missing detection and reconnection.
Template IOs
Identifier | Parameter | Type | Mode | Attribute | Configuration | Value |
---|---|---|---|---|---|---|
transport | Transport | String | Input | Not attribute | Constant | Serial.UC96:/dev/rfcomm0:9600||1000:40-20 |
dev | Device to bind
Like to "58:F4:04:33:D5:FD" for binding by "rfcomm bind {N} 58:F4:04:33:D5:FD". |
String | Input | Not attribute | Constant | |
noDataTm | No data detection time, seconds | Integer | Input | Not attribute | Constant | 60 |
V | Volts | Real | Input | Read only | Variable | |
A | Amperes | Real | Input | Read only | Variable | |
W | Watts | Real | Input | Read only | Variable | |
R | Resistance, Om | Real | Input | Read only | Variable | |
T | Temperature, °С | Integer | Input | Read only | Variable | |
Ah | Capacity, Ah | Real | Input | Read only | Variable | |
Wh | Capacity, Wh | Real | Input | Read only | Variable | |
Tm | Time, seconds | Integer | Input | Read only | Variable | |
clear | Clear | Boolean | Input | Full access | Variable | |
this | Object | Object | Input | Not attribute | Variable | |
f_err | Function error | String | Input | Not attribute | Variable | 0 |
f_stop | Function stop flag | Boolean | Input | Not attribute | Variable | 0 |
f_start | Function start flag | Boolean | Input | Not attribute | Variable | 0 |
f_frq | Frequency of calculation of the function, Hz | Real | Input | Not attribute | Variable | 1000 |
Configuring and using
3 One Wire by DS9097 (1W_DS9097) |
1.2 | GPLv2 | * | en | |
4 One Wire by DS9097U (1W_DS9097U) |
1.2 | GPLv2 | * | 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.
Template IOs
Identifier | 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 |
Configuring and using
5 I2C: PCF8591 (PCF8591) |
1.0 | GPLv2 | * | en | Roman Savochenko |
I2C 8-bit 4xA/D and D/A converter. Connects through a Serial output transport into the I2C mode.
Template IOs
Identifier | 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 |
Configuring and using
6 I2C: PCF8574 (PCF8574) |
1.0 | GPLv2 | * | en | Roman Savochenko |
I2C 8-bit 8DIO. Connects through a Serial output transport into the I2C mode.
Template IOs
Identifier | 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 |
Configuring and using
7 I2C: ADS101x, ADS111x (ADS111x) |
1.0 | GPLv2 | * | en | Roman Savochenko |
I2C 12/16-bit 4xA/D converter. Connect through a Serial output transport into the I2C mode.
Template IOs
Identifier | 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 |
range | Range, ±V | Integer numbers selection | Input | Full access | Variable | 2 0;1;2;3;4;5 |
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 | |
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 |
Configuring and using
8 I2C: MCP4725 (MCP4725) |
1.0 | GPLv2 | * | en | Roman Savochenko |
I2C 12-bit D/A converter. Connect through a Serial output transport into the I2C mode.
Template IOs
Identifier | 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 | 96 |
vRef | Reference voltage, V | Real | Input | Not attribute | Constant | 3.2 |
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 |
Configuring and using
9 I2C: BMP180 (BMP180) |
1.0 | GPLv2 | * | en | Roman Savochenko |
I2C Pressure and Temperature sensor. Connecting through a Serial output transport into the I2C mode.
Template IOs
Identifier | 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 |
Configuring and using
10 I2C: BME280 (BME280) |
1.0 | GPLv2 | * | en | Arcadiy Kisel, Roman Savochenko |
I2C Barometric Pressure, Temperature and Humidity sensor. Connect through a Serial output transport into the I2C mode.
Template IOs
Identifier | 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 |
Configuring and using
11 I2C: SHT3x (SHT3x) |
1.0 | GPLv2 | * | en | Roman Savochenko |
Digital Temperature and Humidity Sensor for the models: SHT30
Template IOs
Identifier | 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 | 68 |
H | Humidity | Real | Input | Read only | Variable | |
T | Temperature | 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 |
Configuring and using
12 I2C: DS1307,DS3231 (DS3231) |
1.1 | GPLv2 | * | en | Roman Savochenko |
I2C RTC chips DS1307,DS3231 with Temperature sensor and calibration for DS3231. Connects through a Serial output transport into the I2C mode.
Template IOs
Identifier | 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 |
mode | Mode | Integer numbers selection | Input | Full access | Variable | 0
0;1 |
tm | Date and time, YYYY-MM-DDTHH:mm:SS | String | Input | Full access | Variable | |
pSQW | Enable SQUARE-WAVE OUTPUT | Boolean | Input | Full access | Variable | |
pSQWf (dynamically updated) |
SQUARE-WAVE OUTPUT frequency | Integer | Input | Full access | Variable | |
agOff (dynamically created for DS3231) |
Aging offset, [-128...127] | Integer | Input | Full access | Variable | |
t (dynamically created for DS3231) |
T, °С | Real | Input | Read only | Variable | |
p32k (dynamically created for DS3231) |
Enable 32768Hz | Boolean | 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 |
Configuring and using
13 I2C: AT24C{32|64} (AT24CXX) |
1.0 | GPLv2 | * | 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}>
Configuring and using
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");
14 GPIO: DHT11,22 (DHT) |
1.0 | GPLv2 | * | 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 IOs
Identifier | 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.GPIO.io.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 |
Configuring and using
15 GPIO: MAX6675 (MAX6675) |
0.1 | GPLv2 | * | en | Arcadiy Kisel |
Cold-Junction-Compensated K-Thermocouple-to-Digital Converter (0°C to +1024°C). The module designed for the sensors connect through softSPI by GPIO, mostly it's Raspberry PI BCM2835 GPIO.
Conditions: Exclusively realtime planing in the priority 199 (FIFO-99).
Template IOs
Identifier | 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.GPIO.io.pi |
pin_cs | CS pin number of the GPIO | Integer | Input | Not attribute | Constant | 8 |
pin_sclk | SCLK pin number of the GPIO | Integer | Input | Not attribute | Constant | 11 |
pin_miso | MISO pin number of the GPIO | Integer | Input | Not attribute | Constant | 9 |
t | T, °С | Real | Output | 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 |
Configuring and using
16 GPIO|I2C: 1602A(HD44780) (1602A) |
1.0 | GPLv2 | * | 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 IOs
Identifier | Parameter | Type | Mode | Attribute | Configuration | Value |
---|---|---|---|---|---|---|
transport | Transport of the I2C, Serial (i2c) or GPIO address with function put(), mostly it's BCM2835 (DAQ.GPIO.io.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 |
Configuring and using
Libs/LowLevelDevices/en - GFDL | May 2024 | OpenSCADA 0.9.7 |