Advanced Modbus Module - Scripting Device Creation

We're using Ignition to connect to hundreds of Modbus TCP targets in our facilities, using some scripting I've developed to create devices from exports from our custom IPAM tooling. However, we encounter limitations with the base Ignition Modbus library, particularly with per-unit word order settings, as we have serial strings with devices that have mixed word order encoding. I suspect these are similar issues that drove Phil to create this module.

Our current workaround is clunky, so I'm evaluating the Advanced Modbus module as a potential solution. To fully script the solution, I need documentation on how to:

  1. Create devices using the Advanced Modbus module via scripting

  2. Configure per-unit word order settings on those devices via scripting

Is this possible, and if so, is there documentation available?

system.device.addDevice is compatible with 3rd party drivers, you'll just need to know the type ID used by the driver and the property key (column name) for each of the settings.

@pturmel should be able to provide those.

1 Like

As it happens, I've been improving this functionality, but not yet documented or tested. Feel free to try the following with the very latest driver version:

  1. The deviceType argument is "ModbusClient". The following keys are supported in deviceProps: framing, hostname, althost, backuphost, altbackuphost, maxoutstanding, exectimeout, tframeplus, shortbrowse, txidlimit, and unitscsv.

  2. Supply the complete configuration CSV for your slave units as a multiline string for the unitscsv device property.

Only hostname is required. All others have sane defaults.

{ I consider the unitscsv device prop to still be BETA quality. Bug reports welcome, but functionality is not officially supported. Prior versions use a binary encoded prop that doesn't play well with v8.3. So migration through my last v8.1 version will be required. }

4 Likes

FWIW, similar for the server driver:

  • deviceType is "ModbusServer"

  • Supported deviceProps are: mastertcp, backuptcp, masterrtu, backuprtu, dropidletcp, persist, persistinterval, tframeplusser, tframeplustcp, shortbrowse, and unitscsv.

4 Likes

Thanks Phil, I will try these props and report back. I have v1.19 installed, is that the latest version available? I took a peek at the config.idb table and noticed that the unit data was stored as a binary blob for each device instance.

No, you should use the beta announced here:

1 Like

I installed this beta version and testing was partially successful in that I could successfully create a device instance, but not successfully create the units. I PM'ed you my test findings.

1 Like