DrvInfluxDbImportV1 Communicator Driver (Custom)
Functional Description
DrvInfluxDbImportV1 is a custom Communicator driver in ScadaV6CommExt for field device connectivity. Protocol details follow the source implementation.
Scope and Version
- Source:
ScadaV6CommExt/DrvInfluxDbImportV1.Logic - TFM:
net8.0 - Version:
6.0.0
Install and Enable
- Deploy driver binaries to Communicator folders.
- Activate driver in Administrator → Communicator → Drivers.
- Upload configuration and restart Communicator.
Line and Device Configuration
- Create a communication line with the proper channel type.
- Add device and set address/timeouts.
- Set polling options and CmdLine as required by this driver; see Functional notes and configuration (template and source) below for file names, address format, and line keys.
CustomOptions (extracted)
| Key | Default | Note |
|---|---|---|
未在源码中匹配到明显的 GetValueAs* 调用,请在 Administrator 中打开该驱动的设备/线路配置界面逐项确认。 | ||
Code hints
58: private DbLineConfig lineConfig;
73: ConnectionRequired = false;
98: if (!lineConfig.Load(Storage, DbLineConfig.GetFileName(LineContext.CommLineNum), out string errMsg))
108: var conn = lineConfig.ConnectionOptions;
152: var response = lineData.InfluxSource.Client.QueryAsync(queryConfig.Sql, lineConfig.ConnectionOptions.Database).Result;
172: var response = lineData.InfluxSource.Client.MultiQueryAsync(queries, lineConfig.ConnectionOptions.Database).Result;
227: lineConfig.ConnectionOptions.Database,
Administrator UI (DrvInfluxDbImportV1.View)
Configure in Administrator → Communicator. Labels below come from the View language pack.
- View source:
ScadaV6CommExt/DrvInfluxDbImportV1.View - Main forms:
FrmDeviceConfig.cs
| Phrase key | Text |
|---|---|
lblCmdCode | Command code |
this | Device {0} Properties - DB Import |
gbCommand | Command Parameters |
lblCmdCodeWarn | Fill out code |
pbSqlInfo.ToolTip | Avaliable parameters: @cmdVal, @cmdData |
pbTagInfo.ToolTip | Each line contains a tag code. |
btnAddCommand.ToolTip | Add Command |
gbDevice | Device Configuration |
CommandName | Command {0} |
CommandsNode | Commands |
UnnamedCommand | |
lblName | Name |
lblSql | SQL |
gbQuery | Query Parameters |
chkActive | Active |
lblName | Name |
lblTag | Tags |
lblSQL | SQL |
chkSingleRow | Single row result |
pbSqlInfo.ToolTip | ON - request returns a single row, each field of which contains a tag value. OFF - request returns a set of rows, each row contains a tag value. Required columns: code and val. |
btnAddQuery.ToolTip | Add Query |
btnMoveUp.ToolTip | Move Up |
btnMoveDown.ToolTip | Move Down |
btnDelete.ToolTip | Delete |
btnSave | Save |
btnCancel | Cancel |
btnClose | Close |
miCollapseAll | Collapse All |
ConnectionNode | Connection Options |
QueryName | Query {0} |
Functional notes and configuration (template and source)
Derived from Logic/Common and device template XML: driver behavior and the Administrator/Communicator fields to set (address, CmdLine, line CustomOptions, template nodes).
Logic location
ScadaV6CommExt/DrvInfluxDbImportV1.Logic- Common:
DrvInfluxDbImportV1.Common
Overrides
OnCommLineStart(), InitDeviceTags(), Session(), SendCommand()
CmdLine / template
未匹配到 PollingOptions.CmdLine 单行片段。
DeviceConfig properties referenced
| Property | Note |
|---|---|
GetFileName | 源码中对 DeviceConfig 的引用 |
Line CustomOptions
| Key | Default |
|---|---|
| 未在 Logic 中检测到 CustomOptions.GetValueAs*(可能全部从设备模板 XML 读取)。 | |
XML keys (Common)
| Node | Note |
|---|---|
SingleRow | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Sql | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Tags | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Tag | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
ConnectionOptions | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Queries | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Commands | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Query | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Command | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Code excerpt
270: ///
271: public override void InitDeviceTags()
272: {
273: if (configError)
304: ///
305: public override void Session()
306: {
307: base.Session();
306: {
307: base.Session();
308:
309: if (DeviceIsNotReady)
362:
363: FinishSession();
364: }
365:
Troubleshooting
- No data: line, address, template, connectivity.
- Template load errors: check logs.
- Options ignored: verify option scope (line vs device).