public class ModbusSlaveFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
close()
Closes all slaves and removes them from the running list
|
static void |
close(ModbusSlave slave)
Closes this slave and removes it from the running list
|
static ModbusSlave |
createSerialSlave(SerialParameters serialParams)
Creates a serial modbus slave or returns the one already allocated to this port
|
static ModbusSlave |
createTCPSlave(InetAddress address,
int port,
int poolSize,
boolean useRtuOverTcp)
Creates a TCP modbus slave or returns the one already allocated to this port
|
static ModbusSlave |
createTCPSlave(InetAddress address,
int port,
int poolSize,
boolean useRtuOverTcp,
int maxIdleSeconds)
Creates a TCP modbus slave or returns the one already allocated to this port
|
static ModbusSlave |
createTCPSlave(int port,
int poolSize)
Creates a TCP modbus slave or returns the one already allocated to this port
|
static ModbusSlave |
createTCPSlave(int port,
int poolSize,
boolean useRtuOverTcp)
Creates a TCP modbus slave or returns the one already allocated to this port
|
static ModbusSlave |
createUDPSlave(InetAddress address,
int port)
Creates a UDP modbus slave or returns the one already allocated to this port
|
static ModbusSlave |
createUDPSlave(int port)
Creates a UDP modbus slave or returns the one already allocated to this port
|
static ModbusSlave |
getSlave(AbstractModbusListener listener)
Returns the running slave that utilises the give listener
|
static ModbusSlave |
getSlave(ModbusSlaveType type,
int port)
Returns the running slave listening on the given port
|
static ModbusSlave |
getSlave(ModbusSlaveType type,
String port)
Returns the running slave listening on the given port
|
public static ModbusSlave createTCPSlave(int port, int poolSize) throws ModbusException
port - Port to listen onpoolSize - Pool size of listener threadsModbusException - If a problem occurs e.g. port already in usepublic static ModbusSlave createTCPSlave(int port, int poolSize, boolean useRtuOverTcp) throws ModbusException
port - Port to listen onpoolSize - Pool size of listener threadsuseRtuOverTcp - True if the RTU protocol should be used over TCPModbusException - If a problem occurs e.g. port already in usepublic static ModbusSlave createTCPSlave(InetAddress address, int port, int poolSize, boolean useRtuOverTcp) throws ModbusException
address - IP address to listen onport - Port to listen onpoolSize - Pool size of listener threadsuseRtuOverTcp - True if the RTU protocol should be used over TCPModbusException - If a problem occurs e.g. port already in usepublic static ModbusSlave createTCPSlave(InetAddress address, int port, int poolSize, boolean useRtuOverTcp, int maxIdleSeconds) throws ModbusException
address - IP address to listen onport - Port to listen onpoolSize - Pool size of listener threadsuseRtuOverTcp - True if the RTU protocol should be used over TCPmaxIdleSeconds - Maximum idle seconds for TCP connectionModbusException - If a problem occurs e.g. port already in usepublic static ModbusSlave createUDPSlave(int port) throws ModbusException
port - Port to listen onModbusException - If a problem occurs e.g. port already in usepublic static ModbusSlave createUDPSlave(InetAddress address, int port) throws ModbusException
address - IP address to listen onport - Port to listen onModbusException - If a problem occurs e.g. port already in usepublic static ModbusSlave createSerialSlave(SerialParameters serialParams) throws ModbusException
serialParams - Serial parameters for serial type slavesModbusException - If a problem occurs e.g. port already in usepublic static void close(ModbusSlave slave)
slave - Slave to removepublic static void close()
public static ModbusSlave getSlave(ModbusSlaveType type, int port)
type - Type of slaveport - Port to check for running slavepublic static ModbusSlave getSlave(ModbusSlaveType type, String port)
type - Type of slaveport - Port to check for running slavepublic static ModbusSlave getSlave(AbstractModbusListener listener)
listener - Listener used for this slaveCopyright © 2025. All Rights Reserved.