DrvIEC102 Communicator Driver (Custom)
Functional Description
DrvIEC102 is a custom Communicator driver in ScadaV6CommExt for field device connectivity. Protocol details follow the source implementation.
Scope and Version
- Source:
ScadaV6CommExt/DrvIEC102.Logic - TFM:
netstandard2.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
13: using System.IO.Ports;
27: protected class TemplateDict : Dictionary
40: private DeviceTemplate deviceTemplate;
48: private string serialPortName = "COM1";
56: private int connectionTimeout = 10000;
57: private int receiveTimeout = 5000;
58: private int sendTimeout = 5000;
70: ConnectionRequired = false;
97: ? $"串口: {serialPortName} ({baudRate},{dataBits},{parity},{stopBits})"
128: catch (TimeoutException ex)
172: if (!string.IsNullOrEmpty(settings.ConnectionType))
173: connectionType = settings.ConnectionType;
178: if (ushort.TryParse(settings.Port, out ushort parsedPort))
179: port = parsedPort;
181: if (!string.IsNullOrEmpty(settings.SerialPortName))
182: serialPortName = settings.SerialPortName;
184: if (int.TryParse(settings.BaudRate, out int parsedBaudRate))
185: baudRate = parsedBaudRate;
243: if (int.TryParse(settings.ConnectionTimeout, out int parsedConnectionTimeout))
244: connectionTimeout = parsedConnectionTimeout;
246: if (int.TryParse(settings.ReceiveTimeout, out int parsedReceiveTimeout))
247: receiveTimeout = parsedReceiveTimeout;
249: if (int.TryParse(settings.SendTimeout, out int parsedSendTimeout))
250: sendTimeout = parsedSendTimeout;
263: endpoint = new SerialEndpoint(serialPortName, baudRate, parity, dataBits, stopBits);
Administrator UI (DrvIEC102.View)
Configure in Administrator → Communicator. Labels below come from the View language pack.
- View source:
ScadaV6CommExt/DrvIEC102.View - Main forms:
FrmDeviceProps.csFrmDeviceTemplate.csFrmTemplateSettings.cs
| Phrase key | Text |
|---|
| No phrases parsed; check Lang folder in View project. |
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/DrvIEC102.Logic- Common:
DrvIEC102.Common
Overrides
Session(), InitDeviceTags(), SendCommand(), OnCommLineTerminate()
CmdLine / template
PollingOptions.CmdLine.Trim();
DeviceConfig properties referenced
| Property | Note |
|---|
| 未检测到 DeviceConfig.* 引用(可能使用基类封装)。 |
Line CustomOptions
| Key | Default |
|---|
| 未在 Logic 中检测到 CustomOptions.GetValueAs*(可能全部从设备模板 XML 读取)。 |
XML keys (Common)
| Node | Note |
|---|
Settings | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
ElemGroups | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
ElemGroup | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Cmds | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Cmd | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
ConnectionType | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Host | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Port | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
SerialPortName | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
BaudRate | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
DataBits | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Parity | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
StopBits | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
LinkAddress | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Password | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
MeasurePoint | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
ConnectionTimeout | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
ReceiveTimeout | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
SendTimeout | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Elem | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Code excerpt
73: #region 主要会话方法
74: public override void Session()
75: {
76: base.Session();
75: {
76: base.Session();
77:
78: try
105:
106: master.StartSession();
107: Log.WriteInfo("IEC102会话已激活");
108:
122:
123: master.EndSession();
124: Log.WriteInfo("IEC102会话已结束");
125: }
157:
158: FinishSession();
159: }
160:
403: #region 设备标签初始化
404: public override void InitDeviceTags()
405: {
406: deviceTemplate = GetDeviceTemplate();
Troubleshooting
- No data: line, address, template, connectivity.
- Template load errors: check logs.
- Options ignored: verify option scope (line vs device).