类 BasicProcessImage

java.lang.Object
com.huangjian.modbus4j.BasicProcessImage
所有已实现的接口:
ProcessImage

public class BasicProcessImage extends Object implements ProcessImage

BasicProcessImage class.

  • 构造器详细资料

    • BasicProcessImage

      public BasicProcessImage(int slaveId)

      Constructor for BasicProcessImage.

      参数:
      slaveId - a int.
  • 方法详细资料

    • getSlaveId

      public int getSlaveId()

      getSlaveId.

      指定者:
      getSlaveId 在接口中 ProcessImage
      返回:
      a int.
    • addListener

      public void addListener(ProcessImageListener l)

      addListener.

      参数:
      l - a ProcessImageListener object.
    • removeListener

      public void removeListener(ProcessImageListener l)

      removeListener.

      参数:
      l - a ProcessImageListener object.
    • 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

      public void setNumeric(int registerId, int dataType, Number value)

      setNumeric.

      参数:
      registerId - a int.
      dataType - a int.
      value - a Number object.
    • setNumeric

      public void setNumeric(int range, int offset, int dataType, Number value)

      setNumeric.

      参数:
      range - a int.
      offset - a int.
      dataType - a int.
      value - a Number object.
    • setString

      public void setString(int range, int offset, int dataType, int registerCount, String s)

      setString.

      参数:
      range - a int.
      offset - a int.
      dataType - a int.
      registerCount - a int.
      s - a String object.
    • setString

      public void setString(int range, int offset, int dataType, int registerCount, Charset charset, String s)

      setString.

      参数:
      range - a int.
      offset - a int.
      dataType - a int.
      registerCount - a int.
      charset - a Charset object.
      s - a String object.
    • setHoldingRegister

      public void setHoldingRegister(int offset, short[] registers)

      setHoldingRegister.

      参数:
      offset - a int.
      registers - an array of
      引用无效
      short
      objects.
    • setInputRegister

      public void setInputRegister(int offset, short[] registers)

      setInputRegister.

      参数:
      offset - a int.
      registers - an array of
      引用无效
      short
      objects.
    • 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

      public boolean getBit(int range, int offset, int bit) throws IllegalDataAddressException

      getBit.

      参数:
      range - a int.
      offset - a int.
      bit - a int.
      返回:
      a boolean.
      抛出:
      IllegalDataAddressException - if any.
    • getHoldingRegisterBit

      public boolean getHoldingRegisterBit(int offset, int bit) throws IllegalDataAddressException

      getHoldingRegisterBit.

      参数:
      offset - a int.
      bit - a int.
      返回:
      a boolean.
      抛出:
      IllegalDataAddressException - if any.
    • getInputRegisterBit

      public boolean getInputRegisterBit(int offset, int bit) throws IllegalDataAddressException

      getInputRegisterBit.

      参数:
      offset - a int.
      bit - a int.
      返回:
      a boolean.
      抛出:
      IllegalDataAddressException - if any.
    • getNumeric

      public Number getNumeric(int range, int offset, int dataType) throws IllegalDataAddressException

      getNumeric.

      参数:
      range - a int.
      offset - a int.
      dataType - a int.
      返回:
      a Number object.
      抛出:
      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 String object.
      抛出:
      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 - a Charset object.
      返回:
      a String object.
      抛出:
      IllegalDataAddressException - if any.
    • getRegister

      public <T> T getRegister(BaseLocator<T> locator) throws IllegalDataAddressException

      getRegister.

      类型参数:
      T - a T object.
      参数:
      locator - a BaseLocator object.
      返回:
      a T object.
      抛出:
      IllegalDataAddressException - if any.
    • getCoil

      public boolean getCoil(int offset) throws IllegalDataAddressException
      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

      public void writeCoil(int offset, boolean value) throws IllegalDataAddressException
      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

      public boolean getInput(int offset) throws IllegalDataAddressException
      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

      public short getHoldingRegister(int offset) throws IllegalDataAddressException
      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

      public void writeHoldingRegister(int offset, short value) throws IllegalDataAddressException
      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

      public short getInputRegister(int offset) throws IllegalDataAddressException
      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.