# Create OPC Device Connection From Script

**URL:** <https://forum.inductiveautomation.com/t/create-opc-device-connection-from-script/104741>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [April 4, 2025, 9:40pm UTC](https://forum.inductiveautomation.com/t/create-opc-device-connection-from-script/104741 "2025-04-04T21:40:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhasan](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@mhasan](https://forum.inductiveautomation.com/u/mhasan)\
**Post date:** [April 4, 2025, 9:40pm UTC](https://forum.inductiveautomation.com/t/create-opc-device-connection-from-script/104741/1 "2025-04-04T21:40:20Z")

</div>

For my workflow I need to create around 60 different Modbus-TCP OPC device connections. I was wondering if there's a way to create them with scripting.

I've found a way to query the current devices using the following code ([method doc](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-opc/system-opc-browseServer)). Just wondering if there's a way to create a device in the same manner as well.

```python
devices = system.opc.browseServer(serverName, "Devices")

```

---

<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:** [April 4, 2025, 9:42pm UTC](https://forum.inductiveautomation.com/t/create-opc-device-connection-from-script/104741/2 "2025-04-04T21:42:57Z")

</div>

> **[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:** [April 4, 2025, 10:17pm UTC](https://forum.inductiveautomation.com/t/create-opc-device-connection-from-script/104741/3 "2025-04-04T22:17:49Z")

</div>

If you want example code, or want to skip having to write a script at all, you might find this Exchange project helpful:

> [@Spreadsheet Import Tool](https://forum.inductiveautomation.com/t/spreadsheet-import-tool/93500):
>
> Now [in the Ignition Exchange](https://inductiveautomation.com/exchange/2660/overview). While waiting on IA review, i Interested parties can also get this here: [https://www.automation-pros.com/SpreadsheetImportTool/](https://www.automation-pros.com/SpreadsheetImportTool/) I intend to publish at this link as well as in the Exchange going forward. Announcements will be in this topic. (:

Particularly if you want to make a bunch of tags and/or UDT instances to go with them.
