DrvBrPvi Communicator Driver (Custom)
Functional Description
DrvBrPvi is a custom Communicator driver in ScadaV6CommExt for field device connectivity. Protocol details follow the source implementation.
Scope and Version
- Source:
ScadaV6CommExt/DrvBrPvi.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 |
|---|---|---|
Username | — | Extracted from source; confirm meaning in driver implementation. |
Password | — | Extracted from source; confirm meaning in driver implementation. |
PviDllPath | — | Extracted from source; confirm meaning in driver implementation. |
Timeout | 3000 | Extracted from source; confirm meaning in driver implementation. |
Arsim | false | Extracted from source; confirm meaning in driver implementation. |
RetryCount | 10 | Extracted from source; confirm meaning in driver implementation. |
Code hints
16: protected DeviceTemplate deviceTemplate;
25: ConnectionRequired = false;
45: string fileName = PollingOptions.CmdLine.Trim();
46: deviceTemplate = new DeviceTemplate();
60: string username = LineContext.LineConfig.CustomOptions.GetValueAsString("Username");
61: string password = LineContext.LineConfig.CustomOptions.GetValueAsString("Password");
62: string pviDllPath = LineContext.LineConfig.CustomOptions.GetValueAsString("PviDllPath");
63: int timeout = LineContext.LineConfig.CustomOptions.GetValueAsInt("Timeout", 3000);
64: bool arsim = LineContext.LineConfig.CustomOptions.GetValueAsBool("Arsim", false);
65: retryCount = Math.Max(1, LineContext.LineConfig.CustomOptions.GetValueAsInt("RetryCount", 10));
211: string[] keys = { "Host", "Ip", "IP", "IPAddress", "TargetIP" };
214: string val = LineContext.LineConfig.CustomOptions.GetValueAsString(key)?.Trim() ?? string.Empty;
Administrator UI (Drv[内部驱动].View)
Configure in Administrator → Communicator. Labels below come from the View language pack.
- View source:
ScadaV6CommExt/Drv[内部驱动].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 DrvBrPvi. 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/DrvBrPvi.Logic- Common:
DrvBrPvi.Common
Overrides
OnCommLineStart(), OnCommLineTerminate(), InitDeviceTags(), Session(), SendCommand()
CmdLine / template
PollingOptions.CmdLine.Trim();
DeviceConfig properties referenced
| Property | Note |
|---|---|
| 未检测到 DeviceConfig.* 引用(可能使用基类封装)。 | |
Line CustomOptions
| Key | Default |
|---|---|
Username | — |
Password | — |
PviDllPath | — |
Timeout | 3000 |
Arsim | false |
RetryCount | 10 |
XML keys (Common)
| Node | Note |
|---|---|
| 未在 Common 中解析到 GetChildAs*/AppendElem 节点(或无 Common 工程)。 | |
Code excerpt
40:
41: public override void InitDeviceTags()
42: {
43: string fileName = PollingOptions.CmdLine.Trim();
42: {
43: string fileName = PollingOptions.CmdLine.Trim();
44: deviceTemplate = new DeviceTemplate();
45:
53: driverCommonLib.InitCommandMaps(deviceTemplate);
54: driverCommonLib.InitDeviceTags(DeviceTags, deviceTemplate);
55: CanSendCommands = deviceTemplate.Cmds.Count > 0;
56:
57: string host = ResolveHost();
58: string username = LineContext.LineConfig.CustomOptions.GetValueAsString("Username");
59: string password = LineContext.LineConfig.CustomOptions.GetValueAsString("Password");
60: string pviDllPath = LineContext.LineConfig.CustomOptions.GetValueAsString("PviDllPath");
58: string username = LineContext.LineConfig.CustomOptions.GetValueAsString("Username");
59: string password = LineContext.LineConfig.CustomOptions.GetValueAsString("Password");
60: string pviDllPath = LineContext.LineConfig.CustomOptions.GetValueAsString("PviDllPath");
61: int timeout = LineContext.LineConfig.CustomOptions.GetValueAsInt("Timeout", 3000);
59: string password = LineContext.LineConfig.CustomOptions.GetValueAsString("Password");
60: string pviDllPath = LineContext.LineConfig.CustomOptions.GetValueAsString("PviDllPath");
61: int timeout = LineContext.LineConfig.CustomOptions.GetValueAsInt("Timeout", 3000);
62: bool arsim = LineContext.LineConfig.CustomOptions.GetValueAsBool("Arsim", false);
Troubleshooting
- No data: line, address, template, connectivity.
- Template load errors: check logs.
- Options ignored: verify option scope (line vs device).