DrvUdpCameraControl Communicator Driver (Custom)
Functional Description
DrvUdpCameraControl is a custom Communicator driver in ScadaV6CommExt for field device connectivity. Protocol details follow the source implementation.
Scope and Version
- Source:
ScadaV6CommExt/DrvUdpCameraControl.Logic - TFM:
net8.0 - Version:
6.1.6
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
27: protected class TemplateDict : Dictionary
41: protected DeviceTemplate deviceTemplate; //KP 数据使用的设备模板
42: private int ServerPort = 9300;// 服务端口
48: ConnectionRequired = false; //不使用默认连接池
105: deviceTemplate = GetDeviceTemplate();
107: ServerPort = int.Parse(deviceTemplate.Port);
110: Log.WriteAction($"[启动]线路编号:{lineNum}, UDP端口:{ServerPort} ");
111: var updServer = UdpServerManager.CreateServer(lineNum, ServerPort);
204: protected virtual DeviceTemplate GetDeviceTemplate()
206: DeviceTemplate deviceTemplate = null;
217: if (templateDict.TryGetValue(fileName, out DeviceTemplate existingTemplate))
225: DeviceTemplate newTemplate = new DeviceTemplate();
Administrator UI (DrvUdpCameraControl.View)
Configure in Administrator → Communicator. Labels below come from the View language pack.
- View source:
ScadaV6CommExt/DrvUdpCameraControl.View - Main forms:
FrmConfig.cs
| Phrase key | Text |
|---|---|
| No phrases parsed; check Lang folder in View project. | |
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/DrvUdpCameraControl.Logic- Common:
DrvUdpCameraControl.Common
Overrides
Session(), SendCommand(), InitDeviceTags(), OnCommLineStart(), OnCommLineTerminate()
CmdLine / template
未匹配到 PollingOptions.CmdLine 单行片段。
DeviceConfig properties referenced
| Property | Note |
|---|---|
| 未检测到 DeviceConfig.* 引用(可能使用基类封装)。 | |
Line CustomOptions
| Key | Default |
|---|---|
| 未在 Logic 中检测到 CustomOptions.GetValueAs*(可能全部从设备模板 XML 读取)。 | |
XML keys (Common)
| Node | Note |
|---|---|
ElemGroups | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
ElemGroup | 来自 Common 配置加载/保存相关源码中的 XML 节点名 |
Code excerpt
49:
50: public override void Session()
51: {
52: base.Session();
51: {
52: base.Session();
53:
54: foreach (var tag in valDic)
60: FinishRequest();
61: FinishSession();
62: }
63:
86: ///
87: public override void InitDeviceTags()
88: {
89: TagGroup tagGroup = new TagGroup("监控列表");
102: {
103: deviceTemplate = GetDeviceTemplate();
104:
105: ServerPort = int.Parse(deviceTemplate.Port);
201: ///
202: protected virtual DeviceTemplate GetDeviceTemplate()
203: {
204: DeviceTemplate deviceTemplate = null;
Troubleshooting
- No data: line, address, template, connectivity.
- Template load errors: check logs.
- Options ignored: verify option scope (line vs device).