类 BasicProcessImage
java.lang.Object
com.huangjian.modbus4j.BasicProcessImage
- 所有已实现的接口:
ProcessImage
BasicProcessImage class.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddListener.booleangetBit(int range, int offset, int bit) getBit.booleangetCoil(int offset) Returns the current value of the coil for the given offset.byteReturns the current value of the exception status.shortgetHoldingRegister(int offset) Returns the current value of the holding register for the given offset.booleangetHoldingRegisterBit(int offset, int bit) getHoldingRegisterBit.booleangetInput(int offset) Returns the current value of the input for the given offset.shortgetInputRegister(int offset) Returns the current value of the input register for the given offset.booleangetInputRegisterBit(int offset, int bit) getInputRegisterBit.shortGetter for the fieldinvalidAddressValue.getNumeric(int range, int offset, int dataType) getNumeric.<T> TgetRegister(BaseLocator<T> locator) getRegister.byte[]Returns the data for the report slave id command.intgetSlaveId.getString(int range, int offset, int dataType, int registerCount) getString.getString.booleanisAllowInvalidAddress.voidremoveListener.voidsetAllowInvalidAddress(boolean allowInvalidAddress) Setter for the fieldallowInvalidAddress.voidsetBinary(int registerId, boolean value) setBinary.voidsetBinary(int range, int offset, boolean value) setBinary.voidsetBit(int range, int offset, int bit, boolean value) setBit.voidsetCoil(int offset, boolean value) Used internally for setting the value of the coil.voidsetExceptionStatus(byte exceptionStatus) Setter for the fieldexceptionStatus.voidsetHoldingRegister(int offset, short value) Used internally for setting the value of the holding register.voidsetHoldingRegister(int offset, short[] registers) setHoldingRegister.voidsetHoldingRegisterBit(int offset, int bit, boolean value) setHoldingRegisterBit.voidsetInput(int offset, boolean value) Used internally for setting the value of the input.voidsetInputRegister(int offset, short value) Used internally for setting the value of the input register.voidsetInputRegister(int offset, short[] registers) setInputRegister.voidsetInputRegisterBit(int offset, int bit, boolean value) setInputRegisterBit.voidsetInvalidAddressValue(short invalidAddressValue) Setter for the fieldinvalidAddressValue.voidsetNumeric(int range, int offset, int dataType, Number value) setNumeric.voidsetNumeric(int registerId, int dataType, Number value) setNumeric.voidsetString.voidsetString.voidwriteCoil(int offset, boolean value) Used to set the coil as a result of a write command from the master.voidwriteHoldingRegister(int offset, short value) Used to set the holding register as a result of a write command from the master.
-
构造器详细资料
-
BasicProcessImage
public BasicProcessImage(int slaveId) Constructor for BasicProcessImage.
- 参数:
slaveId- a int.
-
-
方法详细资料
-
getSlaveId
public int getSlaveId()getSlaveId.
- 指定者:
getSlaveId在接口中ProcessImage- 返回:
- a int.
-
addListener
addListener.
- 参数:
l- aProcessImageListenerobject.
-
removeListener
removeListener.
- 参数:
l- aProcessImageListenerobject.
-
isAllowInvalidAddress
public boolean isAllowInvalidAddress()isAllowInvalidAddress.
- 返回:
- a boolean.
-
setAllowInvalidAddress
public void setAllowInvalidAddress(boolean allowInvalidAddress) Setter for the field
allowInvalidAddress.- 参数:
allowInvalidAddress- a boolean.
-
getInvalidAddressValue
public short getInvalidAddressValue()Getter for the field
invalidAddressValue.- 返回:
- a short.
-
setInvalidAddressValue
public void setInvalidAddressValue(short invalidAddressValue) Setter for the field
invalidAddressValue.- 参数:
invalidAddressValue- a short.
-
setExceptionStatus
public void setExceptionStatus(byte exceptionStatus) Setter for the field
exceptionStatus.- 参数:
exceptionStatus- a byte.
-
setBinary
public void setBinary(int registerId, boolean value) setBinary.
- 参数:
registerId- a int.value- a boolean.
-
setBinary
public void setBinary(int range, int offset, boolean value) setBinary.
- 参数:
range- a int.offset- a int.value- a boolean.
-
setNumeric
setNumeric.
- 参数:
registerId- a int.dataType- a int.value- aNumberobject.
-
setNumeric
setNumeric.
- 参数:
range- a int.offset- a int.dataType- a int.value- aNumberobject.
-
setString
setString.
- 参数:
range- a int.offset- a int.dataType- a int.registerCount- a int.s- aStringobject.
-
setString
public void setString(int range, int offset, int dataType, int registerCount, Charset charset, String s) setString.
-
setHoldingRegister
public void setHoldingRegister(int offset, short[] registers) setHoldingRegister.
- 参数:
offset- a int.registers- an array ofobjects.引用无效
short
-
setInputRegister
public void setInputRegister(int offset, short[] registers) setInputRegister.
- 参数:
offset- a int.registers- an array ofobjects.引用无效
short
-
setBit
public void setBit(int range, int offset, int bit, boolean value) setBit.
- 参数:
range- a int.offset- a int.bit- a int.value- a boolean.
-
setHoldingRegisterBit
public void setHoldingRegisterBit(int offset, int bit, boolean value) setHoldingRegisterBit.
- 参数:
offset- a int.bit- a int.value- a boolean.
-
setInputRegisterBit
public void setInputRegisterBit(int offset, int bit, boolean value) setInputRegisterBit.
- 参数:
offset- a int.bit- a int.value- a boolean.
-
getBit
getBit.
- 参数:
range- a int.offset- a int.bit- a int.- 返回:
- a boolean.
- 抛出:
IllegalDataAddressException- if any.
-
getHoldingRegisterBit
getHoldingRegisterBit.
- 参数:
offset- a int.bit- a int.- 返回:
- a boolean.
- 抛出:
IllegalDataAddressException- if any.
-
getInputRegisterBit
getInputRegisterBit.
- 参数:
offset- a int.bit- a int.- 返回:
- a boolean.
- 抛出:
IllegalDataAddressException- if any.
-
getNumeric
getNumeric.
- 参数:
range- a int.offset- a int.dataType- a int.- 返回:
- a
Numberobject. - 抛出:
IllegalDataAddressException- if any.
-
getString
public String getString(int range, int offset, int dataType, int registerCount) throws IllegalDataAddressException getString.
- 参数:
range- a int.offset- a int.dataType- a int.registerCount- a int.- 返回:
- a
Stringobject. - 抛出:
IllegalDataAddressException- if any.
-
getString
public String getString(int range, int offset, int dataType, int registerCount, Charset charset) throws IllegalDataAddressException getString.
- 参数:
range- a int.offset- a int.dataType- a int.registerCount- a int.charset- aCharsetobject.- 返回:
- a
Stringobject. - 抛出:
IllegalDataAddressException- if any.
-
getRegister
getRegister.
- 类型参数:
T- a T object.- 参数:
locator- aBaseLocatorobject.- 返回:
- a T object.
- 抛出:
IllegalDataAddressException- if any.
-
getCoil
Returns the current value of the coil for the given offset.- 指定者:
getCoil在接口中ProcessImage- 参数:
offset- a int.- 返回:
- the value of the coil
- 抛出:
IllegalDataAddressException- if any.
-
setCoil
public void setCoil(int offset, boolean value) Used internally for setting the value of the coil.- 指定者:
setCoil在接口中ProcessImage- 参数:
offset- a int.value- a boolean.
-
writeCoil
Used to set the coil as a result of a write command from the master.- 指定者:
writeCoil在接口中ProcessImage- 参数:
offset- a int.value- a boolean.- 抛出:
IllegalDataAddressException- if any.
-
getInput
Returns the current value of the input for the given offset.- 指定者:
getInput在接口中ProcessImage- 参数:
offset- a int.- 返回:
- the value of the input
- 抛出:
IllegalDataAddressException- if any.
-
setInput
public void setInput(int offset, boolean value) Used internally for setting the value of the input.- 指定者:
setInput在接口中ProcessImage- 参数:
offset- a int.value- a boolean.
-
getHoldingRegister
Returns the current value of the holding register for the given offset.- 指定者:
getHoldingRegister在接口中ProcessImage- 参数:
offset- a int.- 返回:
- the value of the register
- 抛出:
IllegalDataAddressException- if any.
-
setHoldingRegister
public void setHoldingRegister(int offset, short value) Used internally for setting the value of the holding register.- 指定者:
setHoldingRegister在接口中ProcessImage- 参数:
offset- a int.value- a short.
-
writeHoldingRegister
Used to set the holding register as a result of a write command from the master.- 指定者:
writeHoldingRegister在接口中ProcessImage- 参数:
offset- a int.value- a short.- 抛出:
IllegalDataAddressException- if any.
-
getInputRegister
Returns the current value of the input register for the given offset.- 指定者:
getInputRegister在接口中ProcessImage- 参数:
offset- a int.- 返回:
- the value of the register
- 抛出:
IllegalDataAddressException- if any.
-
setInputRegister
public void setInputRegister(int offset, short value) Used internally for setting the value of the input register.- 指定者:
setInputRegister在接口中ProcessImage- 参数:
offset- a int.value- a short.
-
getExceptionStatus
public byte getExceptionStatus()Returns the current value of the exception status.- 指定者:
getExceptionStatus在接口中ProcessImage- 返回:
- the current value of the exception status.
-
getReportSlaveIdData
public byte[] getReportSlaveIdData()Returns the data for the report slave id command.- 指定者:
getReportSlaveIdData在接口中ProcessImage- 返回:
- the data for the report slave id command.
-