DrvIEC103 Communicator Driver (Custom)
Functional Description
DrvIEC103 is a custom Communicator driver in ScadaV6CommExt for field device connectivity. Protocol details follow the source implementation.
Scope and Version
- Source:
ScadaV6CommExt/DrvIEC103.Logic - TFM:
net8.0 - Version:
V6.x
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
37: ConnectionRequired = false;
47: var rel = DeviceConfig.PollingOptions?.CmdLine?.Trim();
56: if (DeviceConfig.PollingOptions != null)
58: if (DeviceConfig.PollingOptions.Timeout > 0)
59: config.ConnectionTimeout = Math.Max(config.ConnectionTimeout, DeviceConfig.PollingOptions.Timeout);
60: if (DeviceConfig.PollingOptions.Delay > 0)
61: config.ReadTimeout = Math.Max(config.ReadTimeout, DeviceConfig.PollingOptions.Delay);
121: var rel = DeviceConfig.PollingOptions?.CmdLine?.Trim() ?? "";
147: config.ConnectionTimeout, config.ReadTimeout);
175: int connectTimeoutMs = Math.Max(0, config.ConnectionTimeout);
179: connectTimeoutMs, giDev);
223: int quietMs = Math.Max(500, config.ReadTimeout);
224: int maxWaitMs = Math.Max(30_000, Math.Max(config.ReadTimeout, config.ConnectionTimeout) * 30);
Administrator UI (DrvIEC103.View)
Configure in Administrator → Communicator. Labels below come from the View language pack.
- View source:
ScadaV6CommExt/DrvIEC103.View - Main forms:
FrmDeviceProps.csFrmIEC103Config.cs
| Phrase key | Text |
|---|---|
DriverLineHelp | IEC103: add a device per line, set TCP (IP or IP:port) and optional XML template under Config (root DrvIEC103Config). Example: DrvIEC103\mydevice.xml. Embed substation model JSON; use Edit and “Read model from device” when online. Reads: CmdCode IEC103.Data / IEC103.Status / IEC103.GI, or tag device_cpu_group_entry (no CmdVal), or CmdData MessageType=Data and DeviceNumber etc. Single-point control (TYP=45): CmdCode IEC103.SP / IEC103.SinglePointControl with CmdData Fun, Inf, Sco (1=OFF 2=ON, default 2), optional Cot (default 20); or CmdCode device_cpu_fun_inf with CmdVal (0=OFF 1=ON). |
TcpAddressRequired | Set the device TCP address (IP or IP:port) in device properties first. |
FetchModelOk | Substation/device model was read into this template. Click OK to save the XML. |
lblStrAddress | Address (IP or IP:port) |
this | Device {0} Properties — IEC103 |
gbConn | TCP |
TemplateNotExists | Configuration file not found. Leave empty for defaults, or use Edit to create. |
this | IEC103 protocol options |
btnFetchFromDevice | Read model from device |
FetchModelFromDevice | Read model from device |
FetchModelFailed | Read failed or timed out. Check network, device reachability and stack type. |
gbFile | IEC103 XML |
lblConfigFile | Config file (relative to Config) |
btnBrowse | Browse |
btnEdit | Edit |
btnOK | OK |
btnCancel | Cancel |
ConfigDirRequired | Select a file under the configuration directory: {0} |
btnOK | OK |
btnCancel | Cancel |
ConfigSaveError | Failed to save configuration |
XmlFileFilter | XML|*.xml |
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/DrvIEC103.Logic- Common:
DrvIEC103.Common
Overrides
Session(), SendCommand(), OnCommLineTerminate(), InitDeviceTags()
CmdLine / template
未匹配到 PollingOptions.CmdLine 单行片段。
DeviceConfig properties referenced
| Property | Note |
|---|---|
PollingOptions | 源码中对 DeviceConfig 的引用 |
StrAddress | 源码中对 DeviceConfig 的引用 |
Line CustomOptions
| Key | Default |
|---|---|
| 未在 Logic 中检测到 CustomOptions.GetValueAs*(可能全部从设备模板 XML 读取)。 | |
XML keys (Common)
| Node | Note |
|---|---|
| 未在 Common 中解析到 GetChildAs*/AppendElem 节点(或无 Common 工程)。 | |
Code excerpt
98: {
99: var address = DeviceConfig.StrAddress?.Trim() ?? "";
100: var host = address;
101: var port = 2404;
135: }
136: var addr = DeviceConfig.StrAddress?.Trim() ?? "";
137: int jsonLen = config.SubstationModelJson?.Length ?? 0;
138: int jsonHash = 0;
232:
233: public override void Session()
234: {
235: base.Session();
234: {
235: base.Session();
236: try
237: {
341:
342: public override void InitDeviceTags()
343: {
344: DeviceTags.AddStatusTag();
Troubleshooting
- No data: line, address, template, connectivity.
- Template load errors: check logs.
- Options ignored: verify option scope (line vs device).