# \[BUG-14790\] system.device.addDevice - zeroBasedAddressing is inverted

**URL:** <https://forum.inductiveautomation.com/t/bug-14790-system-device-adddevice-zerobasedaddressing-is-inverted/27222>\
**Category:** Ignition Early Access\
**Tags:** ignition80\
**Created:** [August 7, 2019, 10:43am UTC](https://forum.inductiveautomation.com/t/bug-14790-system-device-adddevice-zerobasedaddressing-is-inverted/27222 "2019-08-07T10:43:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![joel.golinucci](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joel.golinucci/32/9927_2.png) [@joel.golinucci](https://forum.inductiveautomation.com/u/joel.golinucci)\
**Post date:** [August 7, 2019, 10:43am UTC](https://forum.inductiveautomation.com/t/bug-14790-system-device-adddevice-zerobasedaddressing-is-inverted/27222/1 "2019-08-07T10:43:35Z")

</div>

When using the function system.device.addDevice with the deviceProps containing “zeroBasedAddressing” : “false”, the device created gets the parameter “One-based addressing” set to false:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/da9f38d806d84fe14525a10970e4245a77bedb9a.png)

The scripting keyword should be oneBasedAddressing to match the gateway GUI parameter (and functionality) or the logic should be inverted (setting zeroBasedAddressing to false should set the GUI parameter “One-based addressing” to true)

---

<div class="post-metadata">

**Author:** ![awalker](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awalker/32/6874_2.png) [@awalker](https://forum.inductiveautomation.com/u/awalker)\
**Post date:** [August 21, 2019, 11:03pm UTC](https://forum.inductiveautomation.com/t/bug-14790-system-device-adddevice-zerobasedaddressing-is-inverted/27222/2 "2019-08-21T23:03:37Z")

</div>

Thank you, I have added a ticket for this and will let you know when its been fixed.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 29, 2019, 12:22am UTC](https://forum.inductiveautomation.com/t/bug-14790-system-device-adddevice-zerobasedaddressing-is-inverted/27222/3 "2019-08-29T00:22:51Z")

</div>

Are you using the keyword-argument based `zeroBasedAddressing`, or passing a dictionary to `deviceProps` with `zeroBasedAddressing`? I’m looking at making a fix, and curious which way it’s actually being used.

---

<div class="post-metadata">

**Author:** ![joel.golinucci](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joel.golinucci/32/9927_2.png) [@joel.golinucci](https://forum.inductiveautomation.com/u/joel.golinucci)\
**Post date:** [September 12, 2019, 6:01am UTC](https://forum.inductiveautomation.com/t/bug-14790-system-device-adddevice-zerobasedaddressing-is-inverted/27222/4 "2019-09-12T06:01:35Z")

</div>

I'm using it in the deviceProps dictionnary:

> deviceProps = {"Hostname" : adresse, "zeroBasedAddressing" : False}  
> system.device.addDevice(deviceType = "ModbusTcp", deviceName = nom, deviceProps = deviceProps)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 12, 2019, 3:25pm UTC](https://forum.inductiveautomation.com/t/bug-14790-system-device-adddevice-zerobasedaddressing-is-inverted/27222/5 "2019-09-12T15:25:18Z")

</div>

Okay, the fix up for review right now is just to add a new `OneBasedAddressing` setting that’s going to do what’s expected - `ZeroBasedAddressing` will still work, but obviously with inverted functionality.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 17, 2019, 3:55pm UTC](https://forum.inductiveautomation.com/t/bug-14790-system-device-adddevice-zerobasedaddressing-is-inverted/27222/6 "2019-10-17T15:55:33Z")

</div>

This is updated in the newest nightly build - basically, the setting that’s exposed to users is now the proper zero-based addressing setting, so addDevice matches actual device configuration.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 13, 2019, 9:08pm UTC](https://forum.inductiveautomation.com/t/bug-14790-system-device-adddevice-zerobasedaddressing-is-inverted/27222/7 "2019-11-13T21:08:29Z")

</div>

7 posts were split to a new topic: [addDevice zeroBasedAddressing not working properly on upgrade](https://forum.inductiveautomation.com/t/adddevice-zerobasedaddressing-not-working-properly-on-upgrade/29925)
