# system.device.listDevices() - specifying server?

**URL:** <https://forum.inductiveautomation.com/t/system-device-listdevices-specifying-server/16721>\
**Category:** Ignition\
**Created:** [January 24, 2018, 11:19pm UTC](https://forum.inductiveautomation.com/t/system-device-listdevices-specifying-server/16721 "2018-01-24T23:19:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian.mcenulty](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@brian.mcenulty](https://forum.inductiveautomation.com/u/brian.mcenulty)\
**Post date:** [January 24, 2018, 11:19pm UTC](https://forum.inductiveautomation.com/t/system-device-listdevices-specifying-server/16721/1 "2018-01-24T23:19:11Z")

</div>

I’m attempting to retrieve a list of devices from a specified server. I know that the listDevices() function doesn’t have any parameters that can be passed into it (like an OPC server name to list devices from). Is there any other function that would allow me to retrieve a list of devices from a specified server?

---

<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:** [January 24, 2018, 11:40pm UTC](https://forum.inductiveautomation.com/t/system-device-listdevices-specifying-server/16721/2 "2018-01-24T23:40:33Z")

</div>

The devices being list are only the ones configured on the local gateway, exposed by the local UA server - the idea of specifying a server doesn’t make any sense.

---

<div class="post-metadata">

**Author:** ![brian.mcenulty](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@brian.mcenulty](https://forum.inductiveautomation.com/u/brian.mcenulty)\
**Post date:** [January 24, 2018, 11:43pm UTC](https://forum.inductiveautomation.com/t/system-device-listdevices-specifying-server/16721/3 "2018-01-24T23:43:34Z")

</div>

What about in the case of remote tag providers? How might I go about listing the devices from them?

---

<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 25, 2018, 1:29am UTC](https://forum.inductiveautomation.com/t/system-device-listdevices-specifying-server/16721/4 "2018-01-25T01:29:08Z")

</div>

Tag providers don’t have devices.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 25, 2018, 1:04pm UTC](https://forum.inductiveautomation.com/t/system-device-listdevices-specifying-server/16721/5 "2018-01-25T13:04:10Z")

</div>

This hasn’t been specified, yet (as a reminder, the more detailed the questions, the better the answers become… ;)), I will assume the following:

- Multiple Ignition servers in a hub and spoke architecture.
- The spoke servers have their SQLTags exposed.

Write your device list to an SQLTag.

If your spoke servers are recent enough to have a Dataset tag type, it’s amazingly simple:

```auto
devices=system.device.listDevices()
system.tag.write("[default]DeviceList", devices)

```

If not, it gets a bit more complex, but you can write it to a String as a list of lists. Easy enough to put back into a dataset, if needed:

```auto
devices=system.dataset.toPyDataSet(system.device.listDevices())

dataOut = []

for row in devices:
  newRow = []
  for col in row:
    newRow.append(col)
  dataOut.append(newRow)

system.tag.write("[default]DeviceList", dataOut)

```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 25, 2018, 1:19pm UTC](https://forum.inductiveautomation.com/t/system-device-listdevices-specifying-server/16721/6 "2018-01-25T13:19:10Z")

</div>

Of course, this is already available through the OPC Tags. Maybe it would help if we knew what you’re envisioning.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4a406572127de3cc5da7309189f7a3d481327f79.png)
