# Way to import devices?

**URL:** <https://forum.inductiveautomation.com/t/way-to-import-devices/21215>\
**Category:** Ignition\
**Created:** [December 4, 2018, 5:52pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215 "2018-12-04T17:52:16Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [December 4, 2018, 5:52pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/1 "2018-12-04T17:52:16Z")

</div>

Is there a way to import devices?  
We have multiple locations that are Identical and compose or more than 50 devices with its own adressing per devices.

Thanks,

---

<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:** [December 4, 2018, 5:59pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/2 "2018-12-04T17:59:06Z")

</div>

There’s no device import/export right now.

You can either script the setup of devices using [system.device.addDevice](https://docs.inductiveautomation.com/display/DOC79/system.device.addDevice) or restore a backup to each location that already has the devices configured.

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [December 4, 2018, 6:15pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/3 "2018-12-04T18:15:19Z")

</div>

Ok, so I can create a program to do so.

Thanks,

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [December 4, 2018, 7:10pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/4 "2018-12-04T19:10:31Z")

</div>

Why would I have this error:  
java.lang.Exception: Device driver ‘MODBUSTCP’ doesn’t exist

Used the syntax in the doc???

---

<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:** [December 4, 2018, 7:22pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/5 "2018-12-04T19:22:35Z")

</div>

Do you have that module installed?

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [December 4, 2018, 8:15pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/6 "2018-12-04T20:15:10Z")

</div>

Yes, I have it. and by default, it is free, so I’m not sure what really means “Do I have that module installed?”

Driver Type listed in Doc:

Legacy Allen-Bradley CompactLogix CompactLogix  
Legacy Allen-Bradley ControlLogix ControlLogix  
Simulators Dairy Demo Simulator DairyDemoSimulator  
DNP3 Driver Dnp3Driver  
Allen-Bradley Logix Driver LogixDriver  
Allen-Bradley MicroLogix MicroLogix  
Modbus RTU ModbusRtuOverTcp  
Modbus TCP ModbusTcp  
Omron NJ Driver com.inductiveautomation.omron.NjDriver  
Allen-Bradley PLC5 PLC5  
Siemens S7-300 S7300  
Siemens S7-400 S7400  
Siemens S7-1200 S71200  
Siemens S7-1500 S71500  
Allen-Bradley SLC SLC  
Simulators SLC Simulator SLCSimulator  
Simulators Generic Simulator Simulator  
TCP Driver TCPDriver  
UDP Driver UDPDriver

---

<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:** [December 4, 2018, 8:18pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/7 "2018-12-04T20:18:02Z")

</div>

Those types are case-sensitive, as all things involving computers should be 😉

The error message says you used `MODBUSTCP` but the docs say it’s `ModbusTcp`.

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [December 4, 2018, 8:21pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/8 "2018-12-04T20:21:10Z")

</div>

Agreed, but the error is capitalised, not the code:

```auto
deviceName = "IS" + str(i) + ".CB" + str(j)
			deviceProps = {
			            "HostName" : "10.10.10." + str((i*10)+j),
			            "Port" : 502,
			            "zeroBasedAddressing" : "false"
			            }
			
			system.device.addDevice("ModbusTcp",deviceName,deviceProps)

```

---

<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:** [December 4, 2018, 8:26pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/9 "2018-12-04T20:26:29Z")

</div>

Can you try calling it with the function arguments specified like the examples?

```auto
system.device.addDevice(deviceType = "S71500", \
                        deviceName = "My_S7_1500_Device",\
                        deviceProps = newProps )

```

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [December 4, 2018, 8:27pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/10 "2018-12-04T20:27:40Z")

</div>

Removed all the the trial modules:

Name : Version : Description : License : State :

: Modbus Driver : 5.9.6 (b2018012914) : A driver for communicating with devices via Modbus-TCP. : Activated :  
: OPC-UA : 4.9.6 (b2018012914) : A cross-platform OPC-UA server. : Activated :  
: UDP and TCP Drivers : 4.9.6 (b2018012914) : Drivers for receiving and parsing UDP or TCP packets. : Activated :  
: User Manual : 4.9.6 (b2018012914) : Provides an offline version of [http://docs.inductiveautomation.com](http://docs.inductiveautomation.com). : Free :

The driver has a dash in it, oh well, lets try that.  
I really need support on a documented feature that fails.

---

<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:** [December 4, 2018, 8:49pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/11 "2018-12-04T20:49:01Z")

</div>

You need to call the function specifically using keyword arguments - there’s an older implementation of addDevice (kept for backwards compatibility) that required a ridiculous sequence of arguments.

```auto
deviceName = "IS1.CB1"
deviceProps = {
            "HostName" : "10.10.10.10",
            "Port" : 502,
            "zeroBasedAddressing" : "false"
            }

system.device.addDevice(deviceType="ModbusTcp", deviceName=deviceName, deviceProps=deviceProps)

```

Worked just fine in 7.9.10.

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [December 5, 2018, 1:19pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/12 "2018-12-05T13:19:14Z")

</div>

OK, so that actually worked. Need to type the argument and this works.  
Great.

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [December 5, 2018, 1:31pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/13 "2018-12-05T13:31:38Z")

</div>

Once the devices are created, any way to get the Addresses in with code as well?

Thanks in advanced

---

<div class="post-metadata">

**Author:** ![c-w-t](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@c-w-t](https://forum.inductiveautomation.com/u/c-w-t)\
**Post date:** [December 20, 2018, 3:31pm UTC](https://forum.inductiveautomation.com/t/way-to-import-devices/21215/14 "2018-12-20T15:31:03Z")

</div>

For similar scenarios where I have repeatable gateway configs I use tags with direct Modbus addressing rather than setting up addresses in the gateway, then you can just import/export your tags as desired and do bulk edits if required in the xml or once imported.
