← Back to Docs

DrvIEC103 Driver (Custom)

DrvIEC103 communicator driver documentation.

Custom Communicator DriversVersionV6.xUpdated2026-04-29OwnerScadaV6CommExt

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

  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

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.cs
    • FrmIEC103Config.cs
Phrase keyText
DriverLineHelpIEC103: 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).
TcpAddressRequiredSet the device TCP address (IP or IP:port) in device properties first.
FetchModelOkSubstation/device model was read into this template. Click OK to save the XML.
lblStrAddressAddress (IP or IP:port)
thisDevice {0} Properties — IEC103
gbConnTCP
TemplateNotExistsConfiguration file not found. Leave empty for defaults, or use Edit to create.
thisIEC103 protocol options
btnFetchFromDeviceRead model from device
FetchModelFromDeviceRead model from device
FetchModelFailedRead failed or timed out. Check network, device reachability and stack type.
gbFileIEC103 XML
lblConfigFileConfig file (relative to Config)
btnBrowseBrowse
btnEditEdit
btnOKOK
btnCancelCancel
ConfigDirRequiredSelect a file under the configuration directory: {0}
btnOKOK
btnCancelCancel
ConfigSaveErrorFailed to save configuration
XmlFileFilterXML|*.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

PropertyNote
PollingOptions源码中对 DeviceConfig 的引用
StrAddress源码中对 DeviceConfig 的引用

Line CustomOptions

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

XML keys (Common)

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