List connected devices in java sdk

I am writing a module and I want to get a list of connected devices. Can someone point me to the some class or function that would allow me to do this.

There is no public API for this.

You could possibly query the “DeviceSettings” table in the internal DB for a list of configured devices but this won’t get you information about whether they are connected or not.

Additionally, being “connected” is not something that is even universal to every type of device, and is not something you can ask of a device even if you could get a list. Every device has getStatus() call that returns String and can be whatever is appropriate at the current time for that type of device.

so there is nothing similar to system.device.listDevices() from python ( I want something similar in java

That function is implemented by querying the DeviceSettings table + using private APIs to get the device status.

Your module could get the script manager to call that python function … (:

Haha :smiley: I was hoping for a java solution but since there is no public API … why not! Thanks

Can a module developer query “DeviceSEttings” Table in the internal DB? If yes how ? Any reading recommendations ?

Where context is a GatewayContext:

List<DeviceSettingsRecord> deviceSettingsRecords = context.getPersistenceInterface().query(
    new SQuery<>(

Thanks so much !!

DeviceSettingsRecord belongs to the OPC UA module, which means your module will have to be dependent on the OPC UA module in order to reference it and run this query.

So I added the following import in my code:

import com.inductiveautomation.ignition.gateway.opcua.server.api.DeviceSettingsRecord;

and the following dependecy in my poml file for the import to work:


but i get this error:

java.lang.NoClassDefFoundError: com/inductiveautomation/ignition/gateway/opcua/server/api/DeviceSettingsRecord

at net.cpxinfra.cpxtools.GatewayHook.deviceListGetter(

at net.cpxinfra.cpxtools.GatewayHook.startup(

at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.startup(

at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.startupModule(

at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$

at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.executeModuleOperation(

at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.installModuleInternal(

at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$InstallCommand.execute(

at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$Receiver.receiveCall(

at com.inductiveautomation.ignition.gateway.redundancy.QueueableMessageReceiver.receiveCall(

at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl.dispatchMessage(

at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl$

at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$

at java.base/java.util.concurrent.Executors$ Source)

at java.base/ Source)

at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ Source)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$ Source)

at java.base/ Source)

Caused by: java.lang.ClassNotFoundException: com.inductiveautomation.ignition.gateway.opcua.server.api.DeviceSettingsRecord

at java.base/ Source)

at com.inductiveautomation.ignition.gateway.modules.ModuleClassLoader.findClass(

at java.base/java.lang.ClassLoader.loadClass(Unknown Source)

at com.inductiveautomation.ignition.gateway.modules.ModuleClassLoader.loadClass(

at java.base/java.lang.ClassLoader.loadClass(Unknown Source)

You need an entry like this in your module configuration as well: