← Back to Docs

DrvLafei485 Driver (Custom)

DrvLafei485 communicator driver documentation.

Custom Communicator DriversVersionV6.xUpdated2026-04-29OwnerScadaV6CommExt

DrvLafei485 Communicator Driver (Custom)

Functional Description

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

Scope and Version

  • Source: ScadaV6CommExt/DrvLafei485.Logic
  • TFM: net8.0
  • Version: V6.x

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

9: using System.IO.Ports;
25: private SerialPortChannelOptions serialOptions;
26: private SerialPort serialPort;
31: ConnectionRequired = false;
38: extraChannel.GetChannelOptions() is SerialPortChannelOptions options)
41: Log.WriteAction($"RS485 channel: {serialOptions.PortName}, {serialOptions.BaudRate}");
51: ClosePort();
71: EnsurePortOpened();
72: serialPort.Write(frame, 0, frame.Length);
253: private void EnsurePortOpened()
255: if (serialPort != null && serialPort.IsOpen)
258: serialPort ??= new SerialPort
260: PortName = serialOptions.PortName,
261: BaudRate = serialOptions.BaudRate,
267: ReadTimeout = 1000,
268: WriteTimeout = 1000
271: if (!serialPort.IsOpen)
272: serialPort.Open();
275: private void ClosePort()
277: if (serialPort == null)
282: if (serialPort.IsOpen)
283: serialPort.Close();
287: serialPort.Dispose();
288: serialPort = null;

Administrator UI (DrvLafei485.View)

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

  • View source: ScadaV6CommExt/DrvLafei485.View
  • Main forms:
    • (无独立 Forms 目录或仅有控件)
Phrase keyText
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/DrvLafei485.Logic
  • Common: DrvLafei485.Common

Overrides

OnCommLineStart(), OnCommLineTerminate(), SendCommand()

CmdLine / template

未匹配到 PollingOptions.CmdLine 单行片段。

DeviceConfig properties referenced

PropertyNote
未检测到 DeviceConfig.* 引用(可能使用基类封装)。

Line CustomOptions

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

XML keys (Common)

NodeNote
未在 Common 中解析到 GetChildAs*/AppendElem 节点(或无 Common 工程)。

Code excerpt

See source files.

Troubleshooting

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