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
- 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
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.csFrmDeviceConn.csFrmDeviceProps.csFrmDeviceTemplate.csFrmReportControlSuffix.csFrmTemplateSettings.cs
| Phrase key | Text |
|---|
this | IEC61850. Device Template Editor |
btnAddCmd.ToolTip | Add command |
gbDevTemplate | Device template |
gbCmd | Command parameters |
lblCmdAddress | Element address |
lblCmdNum | Command number |
CmdsNode | Commands |
DefCmdName | |
lblDevTemplate | Device template |
TemplNotExists | The device template file does not exist. |
btnNew.ToolTip | Create new template |
btnOpen.ToolTip | Open template |
btnSave.ToolTip | Save template |
btnSaveAs.ToolTip | Save template as |
btnEditSettings.ToolTip | Edit template settings |
lblGrAddress | Start element address |
lblElemAddress | Address |
lblCmdName | Name |
lblCmdTableType | Data table |
chkCmdMultiple | Multiple |
lblCmdFuncCode | Function code |
lblCmdElemType | Element type |
lblCmdElemCnt | Element count |
lblCmdByteOrder | Byte order |
lblCmdByteOrderExample | For example, 01234567 |
AddressHint | {0}, starting from {1} |
SaveTemplateConfirm | Template has been modified. Save the changes? |
TemplateFileFilter | Template Files (*.xml)|*.xml|All Files (*.*)|*.* |
this | Device {0} Properties |
gbCommLine | Communication 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
| Property | Note |
|---|
StrAddress | 源码中对 DeviceConfig 的引用 |
Line CustomOptions
| Key | Default |
|---|
| 未在 Logic 中检测到 CustomOptions.GetValueAs*(可能全部从设备模板 XML 读取)。 |
XML keys (Common)
| Node | Note |
|---|
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).