public abstract class ModbusMaster extends Modbus
Modifier and Type | Field and Description |
---|---|
protected boolean |
connected
If connection is established with slave/slaves
|
protected boolean |
initialized |
DEFAULT_MAX_READ_BIT_COUNT, DEFAULT_MAX_READ_REGISTER_COUNT, DEFAULT_MAX_WRITE_REGISTER_COUNT
Constructor and Description |
---|
ModbusMaster() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeMessageControl(MessageControl conn) |
abstract void |
destroy() |
int |
getDiscardDataDelay() |
InputStreamEPollWrapper |
getePoll() |
BaseIOLog |
getIoLog() |
protected MessageControl |
getMessageControl() |
int |
getRetries() |
int |
getTimeout() |
<T> T |
getValue(BaseLocator<T> locator)
Returns a value from the modbus network according to the given locator information.
|
abstract void |
init() |
boolean |
isConnected() |
boolean |
isInitialized() |
boolean |
isMultipleWritesOnly() |
java.util.List<java.lang.Integer> |
scanForSlaveNodes()
Node scanning.
|
ProgressiveTask |
scanForSlaveNodes(NodeScanListener l) |
<K> BatchResults<K> |
send(BatchRead<K> batch)
Useful for sending a number of polling commands at once, or at least in as optimal a batch as possible.
|
ModbusResponse |
send(ModbusRequest request) |
abstract ModbusResponse |
sendImpl(ModbusRequest request) |
void |
setConnected(boolean connected) |
void |
setDiscardDataDelay(int discardDataDelay) |
void |
setePoll(InputStreamEPollWrapper ePoll) |
void |
setIoLog(BaseIOLog ioLog) |
void |
setMultipleWritesOnly(boolean multipleWritesOnly) |
void |
setRetries(int retries) |
void |
setTimeout(int timeout) |
<T> void |
setValue(BaseLocator<T> locator,
java.lang.Object value)
Sets the given value in the modbus network according to the given locator information.
|
boolean |
testSlaveNode(int node) |
getExceptionHandler, getMaxReadBitCount, getMaxReadCount, getMaxReadRegisterCount, getMaxWriteRegisterCount, setExceptionHandler, setMaxReadBitCount, setMaxReadRegisterCount, setMaxWriteRegisterCount, validateNumberOfBits, validateNumberOfRegisters
protected boolean connected
protected boolean initialized
public boolean isConnected()
public void setConnected(boolean connected)
public abstract void init() throws ModbusInitException
ModbusInitException
public boolean isInitialized()
public abstract void destroy()
public final ModbusResponse send(ModbusRequest request) throws ModbusTransportException
ModbusTransportException
public abstract ModbusResponse sendImpl(ModbusRequest request) throws ModbusTransportException
ModbusTransportException
public <T> T getValue(BaseLocator<T> locator) throws ModbusTransportException, ErrorResponseException
locator
- the information required to locate the value in the modbus network.ModbusTransportException
- if there was an IO error or other technical failure while sending the messageErrorResponseException
- if the response returned from the slave was an exception.public <T> void setValue(BaseLocator<T> locator, java.lang.Object value) throws ModbusTransportException, ErrorResponseException
locator
- the information required to locate the value in the modbus network.ModbusTransportException
- if there was an IO error or other technical failure while sending the messageErrorResponseException
- if the response returned from the slave was an exception.public java.util.List<java.lang.Integer> scanForSlaveNodes()
public ProgressiveTask scanForSlaveNodes(NodeScanListener l)
public boolean testSlaveNode(int node)
public int getRetries()
public void setRetries(int retries)
public int getTimeout()
public void setTimeout(int timeout)
public boolean isMultipleWritesOnly()
public void setMultipleWritesOnly(boolean multipleWritesOnly)
public int getDiscardDataDelay()
public void setDiscardDataDelay(int discardDataDelay)
public BaseIOLog getIoLog()
public void setIoLog(BaseIOLog ioLog)
public InputStreamEPollWrapper getePoll()
public void setePoll(InputStreamEPollWrapper ePoll)
public <K> BatchResults<K> send(BatchRead<K> batch) throws ModbusTransportException, ErrorResponseException
protected MessageControl getMessageControl()
protected void closeMessageControl(MessageControl conn)
Copyright © 2014 Infinite Automation Systems. All Rights Reserved.