DrvBachmannSvi Communicator Driver (Custom)
Functional Description
DrvBachmannSvi is a custom Communicator driver in ScadaV6CommExt for field device connectivity. Protocol details follow the source implementation.
Scope and Version
- Source:
ScadaV6CommExt/DrvBachmannSvi.Logic - TFM:
net8.0 - Version:
6.0.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 |
|---|---|---|
RetryCount | 10 | Extracted from source; confirm meaning in driver implementation. |
Username | — | Extracted from source; confirm meaning in driver implementation. |
Password | — | Extracted from source; confirm meaning in driver implementation. |
Timeout | 3000 | Extracted from source; confirm meaning in driver implementation. |
Code hints
17: protected DeviceTemplate deviceTemplate;
26: ConnectionRequired = false;
46: string fileName = PollingOptions.CmdLine.Trim();
47: deviceTemplate = new DeviceTemplate();
60: retryCount = Math.Max(1, LineContext.LineConfig.CustomOptions.GetValueAsInt("RetryCount", 10));
62: string username = LineContext.LineConfig.CustomOptions.GetValueAsString("Username");
63: string password = LineContext.LineConfig.CustomOptions.GetValueAsString("Password");
64: int timeout = LineContext.LineConfig.CustomOptions.GetValueAsInt("Timeout", 3000);
210: string[] keys = { "Host", "Ip", "IP", "IPAddress", "TargetIP" };
213: string val = LineContext.LineConfig.CustomOptions.GetValueAsString(key)?.Trim() ?? string.Empty;
Administrator UI (DrvIEC104.View)
Configure in Administrator → Communicator. Labels below come from the View language pack.
- View source:
ScadaV6CommExt/DrvIEC104.View - Main forms:
FrmAuthSetting.csFrmDeviceProps.csFrmDeviceTemplate.csFrmTemplateSettings.cs
| Phrase key | Text |
|---|---|
this | IEC104. 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 |
cbCmdTableType.Items[0] | 归一化遥测值 (NVA) |
cbCmdTableType.Items[1] | 标度化值(SVA) |
cbCmdTableType.Items[2] | 短浮点数(Float) |
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? |
Administrator UI
No matching Drv*.View project found for DrvBachmannSvi. Use the actual device/line property dialogs in Administrator.
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/DrvBachmannSvi.Logic- Common:
DrvBachmannSvi.Common
Overrides
OnCommLineStart(), OnCommLineTerminate(), InitDeviceTags(), Session(), SendCommand()
CmdLine / template
PollingOptions.CmdLine.Trim();
DeviceConfig properties referenced
| Property | Note |
|---|---|
| 未检测到 DeviceConfig.* 引用(可能使用基类封装)。 | |
Line CustomOptions
| Key | Default |
|---|---|
RetryCount | 10 |
Username | — |
Password | — |
Timeout | 3000 |
XML keys (Common)
| Node | Note |
|---|---|
| 未在 Common 中解析到 GetChildAs*/AppendElem 节点(或无 Common 工程)。 | |
Code excerpt
41:
42: public override void InitDeviceTags()
43: {
44: string fileName = PollingOptions.CmdLine.Trim();
43: {
44: string fileName = PollingOptions.CmdLine.Trim();
45: deviceTemplate = new DeviceTemplate();
46:
54: driverCommonLib.InitCommandMaps(deviceTemplate);
55: driverCommonLib.InitDeviceTags(DeviceTags, deviceTemplate);
56: CanSendCommands = deviceTemplate.Cmds.Count > 0;
57:
57:
58: retryCount = Math.Max(1, LineContext.LineConfig.CustomOptions.GetValueAsInt("RetryCount", 10));
59: string host = ResolveHost();
60: string username = LineContext.LineConfig.CustomOptions.GetValueAsString("Username");
59: string host = ResolveHost();
60: string username = LineContext.LineConfig.CustomOptions.GetValueAsString("Username");
61: string password = LineContext.LineConfig.CustomOptions.GetValueAsString("Password");
62: int timeout = LineContext.LineConfig.CustomOptions.GetValueAsInt("Timeout", 3000);
60: string username = LineContext.LineConfig.CustomOptions.GetValueAsString("Username");
61: string password = LineContext.LineConfig.CustomOptions.GetValueAsString("Password");
62: int timeout = LineContext.LineConfig.CustomOptions.GetValueAsInt("Timeout", 3000);
63:
Troubleshooting
- No data: line, address, template, connectivity.
- Template load errors: check logs.
- Options ignored: verify option scope (line vs device).