public class BasicProcessImage extends Object implements ProcessImage
| 构造器和说明 |
|---|
BasicProcessImage(int slaveId) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addListener(ProcessImageListener l) |
boolean |
getBit(int range,
int offset,
int bit) |
boolean |
getCoil(int offset)
Returns the current value of the coil for the given offset.
|
byte |
getExceptionStatus()
Returns the current value of the exception status.
|
short |
getHoldingRegister(int offset)
Returns the current value of the holding register for the given offset.
|
boolean |
getHoldingRegisterBit(int offset,
int bit) |
boolean |
getInput(int offset)
Returns the current value of the input for the given offset.
|
short |
getInputRegister(int offset)
Returns the current value of the input register for the given offset.
|
boolean |
getInputRegisterBit(int offset,
int bit) |
short |
getInvalidAddressValue() |
Number |
getNumeric(int range,
int offset,
int dataType) |
<T> T |
getRegister(BaseLocator<T> locator) |
byte[] |
getReportSlaveIdData()
Returns the data for the report slave id command.
|
int |
getSlaveId() |
String |
getString(int range,
int offset,
int dataType,
int registerCount) |
String |
getString(int range,
int offset,
int dataType,
int registerCount,
Charset charset) |
boolean |
isAllowInvalidAddress() |
void |
removeListener(ProcessImageListener l) |
void |
setAllowInvalidAddress(boolean allowInvalidAddress) |
void |
setBinary(int registerId,
boolean value) |
void |
setBinary(int range,
int offset,
boolean value) |
void |
setBit(int range,
int offset,
int bit,
boolean value) |
void |
setCoil(int offset,
boolean value)
Used internally for setting the value of the coil.
|
void |
setExceptionStatus(byte exceptionStatus) |
void |
setHoldingRegister(int offset,
short value)
Used internally for setting the value of the holding register.
|
void |
setHoldingRegister(int offset,
short[] registers) |
void |
setHoldingRegisterBit(int offset,
int bit,
boolean value) |
void |
setInput(int offset,
boolean value)
Used internally for setting the value of the input.
|
void |
setInputRegister(int offset,
short value)
Used internally for setting the value of the input register.
|
void |
setInputRegister(int offset,
short[] registers) |
void |
setInputRegisterBit(int offset,
int bit,
boolean value) |
void |
setInvalidAddressValue(short invalidAddressValue) |
void |
setNumeric(int range,
int offset,
int dataType,
Number value) |
void |
setNumeric(int registerId,
int dataType,
Number value) |
void |
setString(int range,
int offset,
int dataType,
int registerCount,
Charset charset,
String s) |
void |
setString(int range,
int offset,
int dataType,
int registerCount,
String s) |
void |
writeCoil(int offset,
boolean value)
Used to set the coil as a result of a write command from the master.
|
void |
writeHoldingRegister(int offset,
short value)
Used to set the holding register as a result of a write command from the master.
|
public int getSlaveId()
getSlaveId 在接口中 ProcessImagepublic void addListener(ProcessImageListener l)
public void removeListener(ProcessImageListener l)
public boolean isAllowInvalidAddress()
public void setAllowInvalidAddress(boolean allowInvalidAddress)
public short getInvalidAddressValue()
public void setInvalidAddressValue(short invalidAddressValue)
public void setExceptionStatus(byte exceptionStatus)
public void setBinary(int registerId,
boolean value)
public void setBinary(int range,
int offset,
boolean value)
public void setNumeric(int registerId,
int dataType,
Number value)
public void setNumeric(int range,
int offset,
int dataType,
Number value)
public void setString(int range,
int offset,
int dataType,
int registerCount,
String s)
public void setString(int range,
int offset,
int dataType,
int registerCount,
Charset charset,
String s)
public void setHoldingRegister(int offset,
short[] registers)
public void setInputRegister(int offset,
short[] registers)
public void setBit(int range,
int offset,
int bit,
boolean value)
public void setHoldingRegisterBit(int offset,
int bit,
boolean value)
public void setInputRegisterBit(int offset,
int bit,
boolean value)
public boolean getBit(int range,
int offset,
int bit)
throws IllegalDataAddressException
public boolean getHoldingRegisterBit(int offset,
int bit)
throws IllegalDataAddressException
public boolean getInputRegisterBit(int offset,
int bit)
throws IllegalDataAddressException
public Number getNumeric(int range, int offset, int dataType) throws IllegalDataAddressException
public String getString(int range, int offset, int dataType, int registerCount) throws IllegalDataAddressException
public String getString(int range, int offset, int dataType, int registerCount, Charset charset) throws IllegalDataAddressException
public <T> T getRegister(BaseLocator<T> locator) throws IllegalDataAddressException
public boolean getCoil(int offset)
throws IllegalDataAddressException
ProcessImagegetCoil 在接口中 ProcessImageIllegalDataAddressExceptionpublic void setCoil(int offset,
boolean value)
ProcessImagesetCoil 在接口中 ProcessImagepublic void writeCoil(int offset,
boolean value)
throws IllegalDataAddressException
ProcessImagewriteCoil 在接口中 ProcessImageIllegalDataAddressExceptionpublic boolean getInput(int offset)
throws IllegalDataAddressException
ProcessImagegetInput 在接口中 ProcessImageIllegalDataAddressExceptionpublic void setInput(int offset,
boolean value)
ProcessImagesetInput 在接口中 ProcessImagepublic short getHoldingRegister(int offset)
throws IllegalDataAddressException
ProcessImagegetHoldingRegister 在接口中 ProcessImageIllegalDataAddressExceptionpublic void setHoldingRegister(int offset,
short value)
ProcessImagesetHoldingRegister 在接口中 ProcessImagepublic void writeHoldingRegister(int offset,
short value)
throws IllegalDataAddressException
ProcessImagewriteHoldingRegister 在接口中 ProcessImageIllegalDataAddressExceptionpublic short getInputRegister(int offset)
throws IllegalDataAddressException
ProcessImagegetInputRegister 在接口中 ProcessImageIllegalDataAddressExceptionpublic void setInputRegister(int offset,
short value)
ProcessImagesetInputRegister 在接口中 ProcessImagepublic byte getExceptionStatus()
ProcessImagegetExceptionStatus 在接口中 ProcessImagepublic byte[] getReportSlaveIdData()
ProcessImagegetReportSlaveIdData 在接口中 ProcessImageCopyright © 2018. All rights reserved.