DrvCnlDLMS 通信驱动(自研)
功能描述
DrvCnlDLMS 为 ScadaV6CommExt 中的自研 Communicator 驱动,用于与现场设备或系统进行数据采集与命令交互。具体协议与能力以源码实现为准。
适用范围与版本
- 源码目录:
ScadaV6CommExt/DrvCnlDLMS.Logic - 目标框架:
net8.0 - 程序集版本:
6.0.0
安装与启用
- 按 RapidSCADA 标准流程将驱动 DLL 部署到 Communicator 安装目录(保持目录层级)。
- 在 Administrator 中打开项目 → Communicator → 驱动程序,确认驱动已出现在可用列表并激活。
- 上传配置到服务器并重启 Communicator 服务。
线路与设备配置(使用步骤)
- 在 Communicator → 通信线路 中新建线路,选择与本驱动匹配的通道类型(串口 / TCP / UDP 等,以界面为准)。
- 在线路下添加设备,填写设备地址、超时、重试等通用参数。
- 在设备 轮询选项 中配置命令行与其它选项:该驱动可能不通过标准 DeviceTemplate 文件加载,请以源码与界面配置为准。
- 保存项目并上传配置,观察 Communicator 日志与设备状态。
线路 CustomOptions 参数(源码提取)
下表由源码正则提取,供快速对照;最终以实际配置界面与注释为准。
| 参数键 | 默认值/片段 | 说明 |
|---|---|---|
未在源码中匹配到明显的 GetValueAs* 调用,请在 Administrator 中打开该驱动的设备/线路配置界面逐项确认。 | ||
配置相关源码片段(参考)
(当前未提取到典型配置片段,请直接查阅源码目录中的 Logic 文件。)
管理端配置界面(DrvCnlDLMS.View)
配置在 RapidSCADA Administrator → Communicator 中完成。以下词条来自 View 工程语言包,便于对照界面字段含义。
- View 源码:
ScadaV6CommExt/DrvCnlDLMS.View - 主要窗体:
FrmSerialPortChannelOptions.csFrmTcpClientChannelOptions.csFrmUdpChannelOptions.cs
| 界面词条 key | 说明(中文) |
|---|---|
pbConnectionModeHint.ToolTip | Individual - Communicator establishes an individual TCP connection with each device. Shared - Communicator establishes a single shared connection for all devices of the communication line using specified remote IP address. Shared connection is used, for example, if the devices are connected via an Ethernet-Serial gateway. |
pbRemoteUdpPortHint.ToolTip | The default remote UDP port. The same for all devices of the communication line. |
pbBehaviorHint.ToolTip | Master - Communicator sends request to a device and receives answer. Slave - Communicator passively waits for data from a device. |
pbTcpPortHint.ToolTip | In individual connection mode it is used as a default TCP port if no port is specified for a device. In shared connection mode the parameter is required. The 502 port is the default Modbus TCP port. |
pbBehaviorHint.ToolTip | Master - Communicator sends request to a device and receives answer. Slave - Communicator passively waits for data from a device. |
pbRemoteIpAddressHint.ToolTip | The default remote IP address. It can be used, for example, if the devices are connected via an Ethernet-Serial gateway. |
this | Serial Port Options |
gbPort | Serial Port |
lblTcpPort | Remote TCP port |
cbDeviceMapping.Items[0] | By IP address |
pbDeviceMappingHint.ToolTip | The method of binding a new incoming connection to a device: By IP address - remote IP address equals a device string address. Driver determined - algorithm is implemented in the device driver. |
lblLocalUdpPort | Local UDP port |
pbLocalUdpPortHint.ToolTip | Local UDP port for incoming connections. Incoming connections must be allowed by a firewall. |
lblRemoteUdpPort | Remote UDP port |
lblPortName | Port name |
lblBaudRate | Baud rate |
cbBehavior.Items[0] | Master |
cbBehavior.Items[1] | Slave |
this | TCP Client Options |
pbHostHint.ToolTip | Remote DNS name or IP address in case of using shared connection. |
this | UDP Options |
lblDeviceMapping | Device mapping |
cbDeviceMapping.Items[1] | Driver determined |
lblRemoteIpAddress | Remote IP address |
ChannelTypeNotFound | Communication channel type not found. |
lblDataBits | Data bits |
lblParity | Parity |
cbParity.Items[0] | None |
cbParity.Items[1] | Odd |
cbParity.Items[2] | Even |
完整模板编辑(如存在)一般在「设备模板编辑器」窗体中维护 XML/CSV 导入导出。
功能依据与配置要点(模板与源码)
下列要点依据仓库内 Logic / Common 及设备模板 XML 归纳,用于说明本驱动的行为以及在 Administrator / Communicator 中需要配置的项(设备地址、CmdLine、线路 CustomOptions、模板 XML 节点等)。
逻辑入口
- Logic 目录:
ScadaV6CommExt/DrvCnlDLMS.Logic - Common 目录:(未匹配到同名 Common,可能合并或命名不同)
重写的关键方法
(未检测到 override 方法名,可能结构不同)
设备模板 / CmdLine
未匹配到 PollingOptions.CmdLine 单行片段。
DeviceConfig 字段引用(源码中出现)
| 属性 | 说明 |
|---|---|
| 未检测到 DeviceConfig.* 引用(可能使用基类封装)。 | |
线路 CustomOptions(GetValueAs*)
| 参数键 | 默认值/片段 |
|---|---|
| 未在 Logic 中检测到 CustomOptions.GetValueAs*(可能全部从设备模板 XML 读取)。 | |
模板/配置 XML 节点(Common 提取)
| XML 节点 | 备注 |
|---|---|
| 未在 Common 中解析到 GetChildAs*/AppendElem 节点(或无 Common 工程)。 | |
关键源码片段(节选)
80: {
81: options = new UdpChannelOptions(channelConfig.CustomOptions);
82: }
83:
127: {
128: options = new TcpClientChannelOptions(channelConfig.CustomOptions);
129: }
130:
排障
- 设备无数据:检查线路通道、地址、模板文件、网络/串口连通性。
- 模板加载失败:查看 Communicator 日志中
Device template/Load template相关错误。 - 参数不生效:确认 CustomOptions 是否写在线路或设备正确层级(以驱动读取位置为准)。