类 TcpMaster
java.lang.Object
com.huangjian.modbus4j.Modbus
com.huangjian.modbus4j.ModbusMaster
com.huangjian.modbus4j.ip.tcp.TcpMaster
TcpMaster class.
-
字段概要
从类继承的字段 com.huangjian.modbus4j.ModbusMaster
connected, initialized, validateResponse从类继承的字段 com.huangjian.modbus4j.Modbus
DEFAULT_MAX_READ_BIT_COUNT, DEFAULT_MAX_READ_REGISTER_COUNT, DEFAULT_MAX_WRITE_REGISTER_COUNT -
构造器概要
构造器构造器说明TcpMaster(IpParameters params, boolean keepAlive) Constructor for TcpMaster.TcpMaster(IpParameters params, boolean keepAlive, boolean autoIncrementTransactionId) Constructor for TcpMaster.TcpMaster(IpParameters params, boolean keepAlive, boolean autoIncrementTransactionId, boolean validateResponse) Constructor for TcpMaster.TcpMaster(IpParameters params, boolean keepAlive, boolean autoIncrementTransactionId, boolean validateResponse, Integer lingerTime) Constructor for TcpMaster.TcpMaster(IpParameters params, boolean keepAlive, Integer lingerTime) Constructor for TcpMaster. -
方法概要
修饰符和类型方法说明voiddestroy()destroy.Getter for the fieldlingerTime.protected shortGetter for the fieldnextTransactionId.voidinit()init.sendImpl(ModbusRequest request) sendImpl.voidsetNextTransactionId(short id) Setter for the fieldnextTransactionId.从类继承的方法 com.huangjian.modbus4j.ModbusMaster
closeMessageControl, getDiscardDataDelay, getePoll, getIoLog, getMessageControl, getRetries, getTimeout, getValue, isConnected, isInitialized, isMultipleWritesOnly, scanForSlaveNodes, scanForSlaveNodes, send, send, setConnected, setDiscardDataDelay, setePoll, setIoLog, setMultipleWritesOnly, setRetries, setTimeout, setValue, testSlaveNode
-
构造器详细资料
-
TcpMaster
public TcpMaster(IpParameters params, boolean keepAlive, boolean autoIncrementTransactionId, boolean validateResponse, Integer lingerTime) Constructor for TcpMaster.
- 参数:
params-keepAlive-autoIncrementTransactionId-validateResponse- - confirm that requested slave id is the same in the responselingerTime- The setting only affects socket close.
-
TcpMaster
public TcpMaster(IpParameters params, boolean keepAlive, boolean autoIncrementTransactionId, boolean validateResponse) Constructor for TcpMaster.
Default to lingerTime disabled- 参数:
params-keepAlive-autoIncrementTransactionId-validateResponse- - confirm that requested slave id is the same in the response
-
TcpMaster
Constructor for TcpMaster.
Default to not validating the slave id in responses Default to lingerTime disabled- 参数:
params- aIpParametersobject.keepAlive- a boolean.autoIncrementTransactionId- a boolean.
-
TcpMaster
Constructor for TcpMaster.
Default to auto increment transaction id Default to not validating the slave id in responses Default to lingerTime disabled- 参数:
params- aIpParametersobject.keepAlive- a boolean.lingerTime- an Integer. The setting only affects socket close.
-
TcpMaster
Constructor for TcpMaster.
Default to auto increment transaction id Default to not validating the slave id in responses Default to lingerTime disabled- 参数:
params- aIpParametersobject.keepAlive- a boolean.
-
-
方法详细资料
-
setNextTransactionId
public void setNextTransactionId(short id) Setter for the field
nextTransactionId.- 参数:
id- a short.
-
getNextTransactionId
protected short getNextTransactionId()Getter for the field
nextTransactionId.- 返回:
- a short.
-
init
init.
- 指定者:
init在类中ModbusMaster- 抛出:
ModbusInitException- if any.
-
destroy
public void destroy()destroy.
- 指定者:
destroy在类中ModbusMaster
-
sendImpl
sendImpl.
- 指定者:
sendImpl在类中ModbusMaster- 参数:
request- aModbusRequestobject.- 返回:
- a
ModbusResponseobject. - 抛出:
ModbusTransportException- if any.
-
getLingerTime
Getter for the field
lingerTime.- 返回:
- an Integer.
-