← Back to Docs

DrvIEC61850 Driver (Custom)

DrvIEC61850 communicator driver documentation.

Custom Communicator DriversVersion6.4.0Updated2026-04-29OwnerScadaV6CommExt

DrvIEC61850 Communicator Driver (Custom)

Functional Description

DrvIEC61850 is a custom Communicator driver in ScadaV6CommExt for field device connectivity. Protocol details follow the source implementation.

Scope and Version

  • Source: ScadaV6CommExt/DrvIEC61850.Logic
  • TFM: net8.0
  • Version: 6.4.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

34: protected class TemplateDict : Dictionary
49: ConnectionRequired = false; //不使用默认连接池
58: private IedConnection mIEC61850Con; //IEC61850 连接
61: protected DeviceTemplate deviceTemplate; //数据使用的设备模板
82: MmsConnection mmsConnection = this.mIEC61850Con.GetMmsConnection();
89: MmsValue multipleResult = mmsConnection.ReadMultipleVariables(multipleVar.Key, multipleVar.Value);
174: catch (IedConnectionException iedEx)
572: mIEC61850Con = new IedConnection();
576: if (this.mIEC61850Con.GetState() == IedConnectionState.IED_STATE_CONNECTED)
582: Log.WriteAction($"ConnectToIEC61850-> [{base.Title}] Host: {hostname}, Port: {port}");
587: catch (IedConnectionException conEx)
610: if (int.TryParse(address.Substring(ind + 1), out int parsedPort))
611: port = parsedPort;
624: private void IEC61850StateChanged(IedConnection connection, IedConnectionState newState)
628: if (newState == IedConnectionState.IED_STATE_CONNECTED)
859: deviceTemplate = GetDeviceTemplate();
1022: protected virtual DeviceTemplate GetDeviceTemplate()
1024: DeviceTemplate deviceTemplate = null;
1025: string fileName = PollingOptions.CmdLine.Trim();
1035: if (templateDict.TryGetValue(fileName, out DeviceTemplate existingTemplate))
1043: DeviceTemplate newTemplate = new DeviceTemplateFactory().CreateDeviceTemplate();
1079: return this.mIEC61850Con.GetState() == IedConnectionState.IED_STATE_CONNECTED;

Administrator UI (DrvIEC61850.View)

Configure in Administrator → Communicator. Labels below come from the View language pack.

  • View source: ScadaV6CommExt/DrvIEC61850.View
  • Main forms:
    • ElemInfo.cs
    • FrmDeviceConn.cs
    • FrmDeviceProps.cs
    • FrmDeviceTemplate.cs
    • FrmReportControlSuffix.cs
    • FrmTemplateSettings.cs
Phrase keyText
thisIEC61850. Device Template Editor
btnAddCmd.ToolTipAdd command
gbDevTemplateDevice template
gbCmdCommand parameters
lblCmdAddressElement address
lblCmdNumCommand number
CmdsNodeCommands
DefCmdName
lblDevTemplateDevice template
TemplNotExistsThe device template file does not exist.
btnNew.ToolTipCreate new template
btnOpen.ToolTipOpen template
btnSave.ToolTipSave template
btnSaveAs.ToolTipSave template as
btnEditSettings.ToolTipEdit template settings
lblGrAddressStart element address
lblElemAddressAddress
lblCmdNameName
lblCmdTableTypeData table
chkCmdMultipleMultiple
lblCmdFuncCodeFunction code
lblCmdElemTypeElement type
lblCmdElemCntElement count
lblCmdByteOrderByte order
lblCmdByteOrderExampleFor example, 01234567
AddressHint{0}, starting from {1}
SaveTemplateConfirmTemplate has been modified. Save the changes?
TemplateFileFilterTemplate Files (*.xml)|*.xml|All Files (*.*)|*.*
thisDevice {0} Properties
gbCommLineCommunication line

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/DrvIEC61850.Logic
  • Common: DrvIEC61850.Common

Overrides

Session(), SendCommand(), OnCommLineStart(), OnCommLineTerminate(), InitDeviceTags()

CmdLine / template

  • PollingOptions.CmdLine.Trim();

DeviceConfig properties referenced

PropertyNote
StrAddress源码中对 DeviceConfig 的引用

Line CustomOptions

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

XML keys (Common)

NodeNote
Settings来自 Common 配置加载/保存相关源码中的 XML 节点名
ElemGroups来自 Common 配置加载/保存相关源码中的 XML 节点名
Cmds来自 Common 配置加载/保存相关源码中的 XML 节点名
Cmd来自 Common 配置加载/保存相关源码中的 XML 节点名
ReportGIInterval来自 Common 配置加载/保存相关源码中的 XML 节点名
RecordingDir来自 Common 配置加载/保存相关源码中的 XML 节点名
ElemGroup来自 Common 配置加载/保存相关源码中的 XML 节点名
Elem来自 Common 配置加载/保存相关源码中的 XML 节点名

Code excerpt

65: 
66:         public override void Session()
67:         {
68:             if (base.IsTerminated) return;

68:             if (base.IsTerminated) return;
69:             base.Session();
70:             if (deviceTemplate == null)
71:             {

208:             FinishRequest();
209:             FinishSession();
210:         }
211: 

578: 
579:                 var (hostname, port) = ParseAddress(DeviceConfig.StrAddress);
580:                 Log.WriteAction($"ConnectToIEC61850-> [{base.Title}] Host: {hostname}, Port: {port}");
581: 

854: 
855:         public override void InitDeviceTags()
856:         {
857:             deviceTemplate = GetDeviceTemplate();

856:         {
857:             deviceTemplate = GetDeviceTemplate();
858:             if (deviceTemplate == null) return;
859: 

Troubleshooting

  • No data: line, address, template, connectivity.
  • Template load errors: check logs.
  • Options ignored: verify option scope (line vs device).