public class ModbusSlave extends Object
| Modifier and Type | Method and Description |
|---|---|
ProcessImage |
addProcessImage(int unitId,
ProcessImage processImage)
Adds a process image for the given Unit ID
|
void |
close()
Convenience method for closing this port and removing it from the running list - simply
calls ModbusSlaveFactory.close(this)
|
String |
getError()
Returns the last error accrued by the listener
|
int |
getPort()
Returns the port that this IP slave is listening on
|
ProcessImage |
getProcessImage(int unitId)
Returns the process image for the given Unit ID
|
SerialParameters |
getSerialParams()
Returns the serial parameters of this slave if it is a Serial type
|
String |
getThreadName()
Gets the name of the thread used by the listener
|
ModbusSlaveType |
getType()
Returns the type of this slave
|
void |
open()
Opens the listener to service requests
|
ProcessImage |
removeProcessImage(int unitId)
Removes the process image for the given Unit ID
|
void |
setThreadName(String threadName)
Sets the name of the thread used by the listener
|
public ModbusSlaveType getType()
public int getPort()
public ProcessImage getProcessImage(int unitId)
unitId - Unit ID of the associated imagepublic ProcessImage removeProcessImage(int unitId)
unitId - Unit ID of the associated imagepublic ProcessImage addProcessImage(int unitId, ProcessImage processImage)
unitId - Unit ID to associate with this imageprocessImage - Process image to addpublic SerialParameters getSerialParams()
public void open()
throws ModbusException
ModbusException - If we cannot listenpublic void close()
public String getError()
public String getThreadName()
public void setThreadName(String threadName)
threadName - Name to use for the threadCopyright © 2025. All Rights Reserved.