|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.wimpi.modbus.io.ModbusUDPTransaction
public class ModbusUDPTransaction
Class implementing the ModbusTransaction interface for the UDP transport mechanism.
Constructor Summary | |
---|---|
ModbusUDPTransaction()
Constructs a new ModbusUDPTransaction instance. |
|
ModbusUDPTransaction(ModbusRequest request)
Constructs a new ModbusUDPTransaction instance with a given ModbusRequest to be send when the transaction is executed. |
|
ModbusUDPTransaction(UDPMasterConnection con)
Constructs a new ModbusUDPTransaction instance with a given ModbusUDPConnection to be used for transactions. |
|
ModbusUDPTransaction(UDPTerminal terminal)
Constructs a new ModbusUDPTransaction instance with a given UDPTerminal to be used for transactions. |
Method Summary | |
---|---|
void |
execute()
Executes this ModbusTransaction. |
ModbusRequest |
getRequest()
Returns the ModbusRequest instance associated with this ModbusTransaction. |
ModbusResponse |
getResponse()
Returns the ModbusResponse instance associated with this ModbusTransaction. |
int |
getRetries()
Returns the amount of retries for opening the connection for executing the transaction. |
int |
getTransactionID()
Returns the actual transaction identifier of this ModbusTransaction. |
boolean |
isCheckingValidity()
Tests whether the validity of a transaction will be checked. |
void |
setCheckingValidity(boolean b)
Sets the flag that controls whether the validity of a transaction will be checked. |
void |
setRequest(ModbusRequest req)
Sets the ModbusRequest for this ModbusTransaction. |
void |
setRetries(int num)
Set the amount of retries for opening the connection for executing the transaction. |
void |
setTerminal(UDPTerminal terminal)
Sets the terminal on which this ModbusTransaction should be executed. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModbusUDPTransaction()
public ModbusUDPTransaction(ModbusRequest request)
request
- a ModbusRequest instance.public ModbusUDPTransaction(UDPTerminal terminal)
terminal
- a UDPTerminal instance.public ModbusUDPTransaction(UDPMasterConnection con)
con
- a ModbusUDPConnection instance.Method Detail |
---|
public void setTerminal(UDPTerminal terminal)
terminal
- a UDPSlaveTerminal.public void setRequest(ModbusRequest req)
ModbusTransaction
The related ModbusResponse is acquired
from the passed in ModbusRequest instance.
setRequest
in interface ModbusTransaction
req
- a ModbusRequest.public ModbusRequest getRequest()
ModbusTransaction
getRequest
in interface ModbusTransaction
public ModbusResponse getResponse()
ModbusTransaction
getResponse
in interface ModbusTransaction
public int getTransactionID()
ModbusTransaction
getTransactionID
in interface ModbusTransaction
public void setCheckingValidity(boolean b)
ModbusTransaction
setCheckingValidity
in interface ModbusTransaction
b
- true if checking validity, false otherwise.public boolean isCheckingValidity()
ModbusTransaction
isCheckingValidity
in interface ModbusTransaction
public int getRetries()
ModbusTransaction
getRetries
in interface ModbusTransaction
public void setRetries(int num)
ModbusTransaction
setRetries
in interface ModbusTransaction
num
- the amount of retries as int.public void execute() throws ModbusIOException, ModbusSlaveException, ModbusException
ModbusTransaction
execute
in interface ModbusTransaction
ModbusException
- if an I/O error occurs,
or the response is a modbus protocol exception.
ModbusIOException
ModbusSlaveException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |