# Automating address mapping

**URL:** <https://forum.inductiveautomation.com/t/automating-address-mapping/16784>\
**Category:** Ignition\
**Created:** [January 29, 2018, 6:27pm UTC](https://forum.inductiveautomation.com/t/automating-address-mapping/16784 "2018-01-29T18:27:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [January 29, 2018, 6:27pm UTC](https://forum.inductiveautomation.com/t/automating-address-mapping/16784/1 "2018-01-29T18:27:52Z")

</div>

We have configured an Ignition system to allow the customer to add new machinery through the user interface. Using a script we can add a new Modbus TCP/IP device using `system.device.addDevice`.

Is it also possible to set up address mapping in the script as well? This would allow us to refer to addresses using the PLC registers and just use Modbus as the transport mechanism.

---

<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 29, 2018, 6:30pm UTC](https://forum.inductiveautomation.com/t/automating-address-mapping/16784/2 "2018-01-29T18:30:27Z")

</div>

Address mapping is optional for Modbus TCP devices. It’s purpose is to give users something to see in the OPC browser. If you are automating, you can just create the tags with the appropriate addresses and data formats.

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [January 29, 2018, 6:39pm UTC](https://forum.inductiveautomation.com/t/automating-address-mapping/16784/3 "2018-01-29T18:39:05Z")

</div>

Yes, but workers on site are much more familiar with the PLC native addressing, so it would be one less layer for them to learn about if they ever have to maintain the system.

For example, if they are dealing with register D210, they will see an OPC item path like

```auto
ns=l;s=[Device]1.D210

```

instead of a Modbus OPC item path like

```auto
ns=l;s=[Device]1.HR211

```

(including an annoying offset!)

Address mapping works well so it would be a shame not to be able to use it when we automate the process.

---

<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 29, 2018, 6:49pm UTC](https://forum.inductiveautomation.com/t/automating-address-mapping/16784/4 "2018-01-29T18:49:03Z")

</div>

Ah, OK. Well, the entire address map for the device is stored as a string in a property named “AddressMap”, so try to set that in the driver’s deviceProps. You might have to dig around in the SDK example (the modbus driver is published code) for the format. Look at its `ModbusStringParser.toParseableString()`. From a quick look, it’s fairly predictable. You can get some samples, too, if you look in your server’s internal database at the table `ModbusTcpDriverSettings`.

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [January 29, 2018, 6:52pm UTC](https://forum.inductiveautomation.com/t/automating-address-mapping/16784/5 "2018-01-29T18:52:33Z")

</div>

OK Phil, thanks.

I was trying to access the server’s internal database on a 7.9.2 server recently but I couldn’t find it. Where do I look?

---

<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 29, 2018, 7:03pm UTC](https://forum.inductiveautomation.com/t/automating-address-mapping/16784/6 "2018-01-29T19:03:24Z")

</div>

I just had to dig around a bit, since its not linked in the web UI any more: [http://servername:8088/main/web/status/sys.internaldb](http://servername:8088/main/web/status/sys.internaldb)

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [January 29, 2018, 7:37pm UTC](https://forum.inductiveautomation.com/t/automating-address-mapping/16784/7 "2018-01-29T19:37:25Z")

</div>

Thanks Phil. Useful but dangerous!

---

<div class="post-metadata">

**Author:** ![phandc](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@phandc](https://forum.inductiveautomation.com/u/phandc)\
**Post date:** [November 1, 2021, 3:27pm UTC](https://forum.inductiveautomation.com/t/automating-address-mapping/16784/8 "2021-11-01T15:27:15Z")

</div>

@AlThePal Now in 2021, I have taken a look at the internal database containing ModbusDriverSettings. It’s still quite dangerous when we make address mapping via Script. However, I think we still can do that if we defined a flexible structure. In addition, we can import and export the Modbus address to the CSV file in the Gateway at the moment.
