# Advanced Modbus Module - Scripting Device Creation

**URL:** <https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714>\
**Category:** 3rd Party Modules\
**Tags:** scripting\
**Created:** [November 17, 2024, 3:32pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714 "2024-11-17T15:32:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ken.murphy0805](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@ken.murphy0805](https://forum.inductiveautomation.com/u/ken.murphy0805)\
**Post date:** [November 17, 2024, 3:32pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/1 "2024-11-17T15:32:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 17, 2024, 5:04pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/2 "2024-11-17T17:04:18Z")

</div>

`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.

> **[system.device.addDevice - deviceProps Listing | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-device/system-device-addDevice/system-device-addDevice-deviceProps-Listing)**
>
> Below is a table of properties callable by system.device.addDevice.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 17, 2024, 5:39pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/3 "2024-11-17T17:39:20Z")

</div>

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. }

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 17, 2024, 5:53pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/4 "2024-11-17T17:53:31Z")

</div>

FWIW, similar for the server driver:

- `deviceType` is "ModbusServer"

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

---

<div class="post-metadata">

**Author:** ![ken.murphy0805](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@ken.murphy0805](https://forum.inductiveautomation.com/u/ken.murphy0805)\
**Post date:** [November 18, 2024, 12:40pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/5 "2024-11-18T12:40:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 18, 2024, 12:41pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/6 "2024-11-18T12:41:59Z")

</div>

No, you should use the beta announced here:

> [@Automation Professionals' Advanced Modbus Driver](https://forum.inductiveautomation.com/t/automation-professionals-advanced-modbus-driver/41312/76):
>
> Automation Professionals is pleased to announce a BETA release of this Advanced Modbus driver module, with one bugfix and two features. For Ignition v8.1+: [v1.1.10.243132114](https://www.automation-pros.com/ignition/Advanced%20Modbus%20Driver-1.1.10.243132114-v81.modl) Fixed a bug in diagnostics that breaks device diagnostics for all devices in the gateway--that page then looks like no devices are configured. Due to RateStats losing its Comparable\<\> interface somewhere along the way. (And me not noticing.) Added [Diagnostics] folder to OPC browsing--basically a port of the code fr…

---

<div class="post-metadata">

**Author:** ![ken.murphy0805](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@ken.murphy0805](https://forum.inductiveautomation.com/u/ken.murphy0805)\
**Post date:** [November 18, 2024, 2:37pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/7 "2024-11-18T14:37:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 7, 2025, 5:22pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/8 "2025-01-07T17:22:23Z")

</div>

The production release that includes this capability has just been released:

> [@Automation Professionals' Advanced Modbus Driver](https://forum.inductiveautomation.com/t/automation-professionals-advanced-modbus-driver/41312/77):
>
> Automation Professionals is pleased to announce a new production release of this module, with a number of bugfixes, and the new support for scripted device creation (as mentioned [over here](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/3)): For Ignition v8.1+: [v1.1.11.250071612](https://www.automation-pros.com/ignition/Advanced%20Modbus%20Driver-1.1.11.250071612-v81.modl) Notable fixes: File Register read/write framing errors for RTU connections. Input/Holding/File Register corrupted word swapping for all 64-bit data types. Missing parser entry for the "IBCD" data transform for IR, HR, and HR addresses. Fixed stray errors (NPEs in par…

---

<div class="post-metadata">

**Author:** ![msteele](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/msteele/32/77889_2.png) [@msteele](https://forum.inductiveautomation.com/u/msteele)\
**Post date:** [May 16, 2025, 4:07pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/9 "2025-05-16T16:07:42Z")

</div>

Hi Phil,  
Is there additional documentation somewhere around using system.device.addDevice() with this driver?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 16, 2025, 6:06pm UTC](https://forum.inductiveautomation.com/t/advanced-modbus-module-scripting-device-creation/98714/10 "2025-05-16T18:06:46Z")

</div>

Yes, the [current user manual](https://www.automation-pros.com/modbus/UserManual.pdf) has a short section documenting the keys to use in each driver type.
