← Back to Docs

DrvMelsecFx Driver (Custom)

DrvMelsecFx communicator driver documentation.

Custom Communicator DriversVersion6.0.0Updated2026-04-29OwnerScadaV6CommExt

DrvMelsecFx Communicator Driver (Custom)

Functional Description

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

Scope and Version

  • Source: ScadaV6CommExt/DrvMelsecFx.Logic
  • TFM: net8.0
  • Version: 6.0.0

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

22: protected class TemplateDict : Dictionary
36: protected DeviceTemplate deviceTemplate;
77: protected virtual DeviceTemplate CreateDeviceTemplate()
79: return new DeviceTemplate();
85: protected virtual DeviceTemplate GetDeviceTemplate()
87: DeviceTemplate deviceTemplate = null;
88: string fileName = PollingOptions.CmdLine.Trim();
99: if (templateDict.TryGetValue(fileName, out DeviceTemplate existingTemplate))
107: DeviceTemplate newTemplate = CreateDeviceTemplate();
120: public override void OnConnectionSet()
122: if (base.Connection != null)
125: base.Connection.NewLine = "\r\n";
131: transMode = LineContext.LineConfig.CustomOptions.GetValueAsEnum("TransMode", MelsecType.FX);
133: this.deviceTemplate = GetDeviceTemplate();
188: Thread.Sleep(base.DeviceConfig.PollingOptions.Delay);
310: Timeout = DeviceConfig.PollingOptions.Timeout,
311: Connection = Connection,

Administrator UI (DrvMelsecFx.View)

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

  • View source: ScadaV6CommExt/DrvMelsecFx.View
  • Main forms:
    • (无独立 Forms 目录或仅有控件)
Phrase keyText
thisMelsecFx. Device Template Editor
btnAddCmd.ToolTipAdd command
gbDevTemplateDevice template
gbCmdCommand parameters
lblCmdAddressElement address
lblCmdNumCommand number
CmdsNodeCommands
DefCmdName
lblDevTemplateDevice template
TemplNotExistsThe device template file does not exist.
btnNew.ToolTipCreate new template
btnOpen.ToolTipOpen template
btnSave.ToolTipSave template
btnSaveAs.ToolTipSave template as
btnEditSettings.ToolTipEdit template settings
lblGrAddressStart element address
lblElemAddressAddress
lblCmdNameName
lblCmdTableTypeData table
cbCmdTableType.Items[0]Y (0~377)
cbCmdTableType.Items[1]S (0~999)
cbCmdTableType.Items[2]M (0~7679)
cbCmdTableType.Items[3]T (0~255)
cbCmdTableType.Items[4]C (0~511)
cbCmdTableType.Items[5]D (0~7999)
lblCmdFuncCodeFunction code
lblCmdElemTypeElement type
cbCmdElemType.Items[0]ushort (2 bytes)
cbCmdElemType.Items[1]short (2 bytes)
cbCmdElemType.Items[2]uint (4 bytes)

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/DrvMelsecFx.Logic
  • Common: DrvMelsecFx.Common

Overrides

OnConnectionSet(), OnCommLineStart(), InitDeviceTags(), Session(), SendCommand()

CmdLine / template

  • PollingOptions.CmdLine.Trim();

DeviceConfig properties referenced

PropertyNote
NumAddress源码中对 DeviceConfig 的引用
PollingOptions源码中对 DeviceConfig 的引用

Line CustomOptions

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

XML keys (Common)

NodeNote
ElemGroups来自 Common 配置加载/保存相关源码中的 XML 节点名
ElemGroup来自 Common 配置加载/保存相关源码中的 XML 节点名
Cmds来自 Common 配置加载/保存相关源码中的 XML 节点名
Cmd来自 Common 配置加载/保存相关源码中的 XML 节点名

Code excerpt

82:         /// 
83:         protected virtual DeviceTemplate GetDeviceTemplate()
84:         {
85:             DeviceTemplate deviceTemplate = null;

85:             DeviceTemplate deviceTemplate = null;
86:             string fileName = PollingOptions.CmdLine.Trim();
87: 
88:             if (string.IsNullOrEmpty(fileName))

128:         {
129:             transMode = LineContext.LineConfig.CustomOptions.GetValueAsEnum("TransMode", MelsecType.FX);
130: 
131:             this.deviceTemplate = GetDeviceTemplate();

130: 
131:             this.deviceTemplate = GetDeviceTemplate();
132:             if (this.deviceTemplate == null)
133:             {

156: 
157:         public override void InitDeviceTags()
158:         {
159:             if (deviceTemplate != null)

179: 
180:         public override void Session()
181:         {
182:             base.Session();

Troubleshooting

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