system.device.listDevices() - specifying server?

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:

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:

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)