jamod at SF

net.wimpi.modbus.msg
Class WriteMultipleCoilsResponse

java.lang.Object
  extended bynet.wimpi.modbus.msg.ModbusMessageImpl
      extended bynet.wimpi.modbus.msg.ModbusResponse
          extended bynet.wimpi.modbus.msg.WriteMultipleCoilsResponse
All Implemented Interfaces:
ModbusMessage, Transportable

public final class WriteMultipleCoilsResponse
extends ModbusResponse

Class implementing a WriteMultipleCoilsResponse. The implementation directly correlates with the class 1 function read coils (FC 15). It encapsulates the corresponding response message.

Coils are understood as bits that can be manipulated (i.e. set or unset).

Version:
1.2rc1 (09/11/2004)
Author:
Dieter Wimberger

Constructor Summary
WriteMultipleCoilsResponse()
          Constructs a new ReadCoilsResponse instance.
WriteMultipleCoilsResponse(int ref, int count)
          Constructs a new ReadCoilsResponse instance with a given count of coils (i.e. bits).
 
Method Summary
 int getBitCount()
          Returns the number of bits (i.e. coils) read with the request.
 int getReference()
          Returns the reference of the register to to start reading from with this ReadCoilsRequest.
 void readData(java.io.DataInput din)
          Reads the subclass specific data from the given DataInput instance.
 void setBitCount(int count)
          Sets the number of bits (i.e. coils) that will be in a response.
 void writeData(java.io.DataOutput dout)
          Writes the subclass specific data to the given DataOutput.
 
Methods inherited from class net.wimpi.modbus.msg.ModbusResponse
createModbusResponse, setMessage
 
Methods inherited from class net.wimpi.modbus.msg.ModbusMessageImpl
getDataLength, getFunctionCode, getHexMessage, getOutputLength, getProtocolID, getTransactionID, getUnitID, isHeadless, readFrom, setDataLength, setFunctionCode, setHeadless, setHeadless, setProtocolID, setTransactionID, setUnitID, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriteMultipleCoilsResponse

public WriteMultipleCoilsResponse()
Constructs a new ReadCoilsResponse instance.


WriteMultipleCoilsResponse

public WriteMultipleCoilsResponse(int ref,
                                  int count)
Constructs a new ReadCoilsResponse instance with a given count of coils (i.e. bits).

Parameters:
ref - the offset to begin writing from.
count - the number of bits to be read.
Method Detail

getReference

public int getReference()
Returns the reference of the register to to start reading from with this ReadCoilsRequest.

Returns:
the reference of the register to start reading from as int.

getBitCount

public int getBitCount()
Returns the number of bits (i.e. coils) read with the request.

Returns:
the number of bits that have been read.

setBitCount

public void setBitCount(int count)
Sets the number of bits (i.e. coils) that will be in a response.

Parameters:
count - the number of bits in the response.

writeData

public void writeData(java.io.DataOutput dout)
               throws java.io.IOException
Description copied from class: ModbusMessageImpl
Writes the subclass specific data to the given DataOutput.

Specified by:
writeData in class ModbusMessageImpl
Parameters:
dout - the DataOutput to be written to.
Throws:
java.io.IOException - if an I/O related error occurs.

readData

public void readData(java.io.DataInput din)
              throws java.io.IOException
Description copied from class: ModbusMessageImpl
Reads the subclass specific data from the given DataInput instance.

Specified by:
readData in class ModbusMessageImpl
Parameters:
din - the DataInput to read from.
Throws:
java.io.IOException - if an I/O related error occurs.

jamod at SF

Copyright © 2002-2004 jamod development team.