← Back to Docs

DrvIEC102 Driver (Custom)

DrvIEC102 communicator driver documentation.

Custom Communicator DriversVersion6.0.0Updated2026-04-29OwnerScadaV6CommExt

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

  1. Deploy driver binaries to Communicator folders.
  2. Activate driver in Administrator → Communicator → Drivers.
  3. Upload configuration and restart Communicator.

Line and Device Configuration

  1. Create a communication line with the proper channel type.
  2. Add device and set address/timeouts.
  3. 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)

KeyDefaultNote
未在源码中匹配到明显的 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.cs
    • FrmDeviceTemplate.cs
    • FrmTemplateSettings.cs
Phrase keyText
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

PropertyNote
未检测到 DeviceConfig.* 引用(可能使用基类封装)。

Line CustomOptions

KeyDefault
未在 Logic 中检测到 CustomOptions.GetValueAs*(可能全部从设备模板 XML 读取)。

XML keys (Common)

NodeNote
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).