# How to update the configuration of an existing device via System.device

**URL:** <https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 29, 2021, 4:12pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506 "2021-10-29T16:12:05Z")\
**Posts on this page:** 11\
**Page:** 1

<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:** [October 29, 2021, 4:12pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/1 "2021-10-29T16:12:05Z")

</div>

Hi everyone,  
I am trying to update the configuration of an existing device using System.device utilities. I can some devices via script as mentioned in the [System.device.addDevice](https://docs.inductiveautomation.com/display/DOC80/system.device.addDevice) document. Howerver, the system.device utility doesn’t have a function to get info of an existing device by the device name. There’s a function called system.device.getListDevices will return a read-only dataset of devices. You can see in the figure below.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/e/aeb4ff78e2d227986934349a37781f0e06e2aaea.png)

Thank you for your time!

---

<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:** [October 29, 2021, 4:20pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/2 "2021-10-29T16:20:53Z")

</div>

We don’t really have any functions for editing or even list the device configurations right now.

---

<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:** [October 29, 2021, 5:01pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/3 "2021-10-29T17:01:34Z")

</div>

Thanks for your reply.  
Actually, I think I will delete then add a device again in the same script. It’s inconvenient but I think this trick will work.  
If I don’t misunderstand, each device has a unique name. We can refer to a specific device by device name. I hope this feature will happen in the future.

---

<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 2, 2021, 3:05pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/4 "2021-11-02T15:05:04Z")

</div>

@Kevin.Herron Because we don’t have any update functions at the moment, I delete a device then add it with new props again in the same script. I wonder that the new device will be conflicted with the old device. What will happen if we delete a device? All information, historical tags will be deleted immediately or they still exist in the database.

---

<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 2, 2021, 3:08pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/5 "2021-11-02T15:08:20Z")

</div>

Deleting a device is fine, none of your tag information or historical information is touched. This all happens in the OPC server, there is nothing linking the OPC tag to the server/device except the OPC Server and OPC Item Path tag properties. Just make sure you add it back with the same name.

---

<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 2, 2021, 3:36pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/6 "2021-11-02T15:36:53Z")

</div>

Thanks for your reply.  
If I don’t misunderstand. Because the tags still exist, we must add a new device with the same name? Otherwise, the system will notify the error.

---

<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 2, 2021, 3:39pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/7 "2021-11-02T15:39:56Z")

</div>

Yes, if you don’t use the same name when you add it all your OPC tags will have Error\_Config because they will be pointing at OPC Item Paths that no longer exist.

---

<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 2, 2021, 3:49pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/8 "2021-11-02T15:49:01Z")

</div>

Thank you so much for your help.

---

<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 5, 2021, 4:44pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/9 "2021-11-05T16:44:41Z")

</div>

Are there any ways to get a ModbusTCP configuration such as Prefix, UnitId, Addresses? Although we don’t have any functions for retrieving the device configuration, I wonder that we might do that if we write a custom module. I have looked into the ModbusTCPDriverSettings table in the local/data/config.idb file. I think there must be some ways to interact with that data.

---

<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 5, 2021, 4:51pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/10 "2021-11-05T16:51:36Z")

</div>

Nothing supported. If you want to risk [digging around in the internal db](https://forum.inductiveautomation.com/t/connecting-to-adhoc-sqlite-database-from-jython/52698/11) nobody will stop you.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 5, 2021, 6:32pm UTC](https://forum.inductiveautomation.com/t/how-to-update-the-configuration-of-an-existing-device-via-system-device/52506/11 "2021-11-05T18:32:49Z")

</div>

> [@Kevin.Herron](#):
>
> If you want to risk [digging around in the internal db](https://forum.inductiveautomation.com/t/connecting-to-adhoc-sqlite-database-from-jython/52698/11)

Just keep in mind that you can only run this from the gateway scope. I created a gateway message handler that ran this script and returned the result. Then I can use `system.util.sendRequest` from any scope to run the message handler and hence the query
