code: public void writeMultipleCoils(int unitId, int ref, BitVector coils) throws ModbusException {
          checkTransaction();
          if (writeMultipleCoilsRequest == null) {
              writeMultipleCoilsRequest = new WriteMultipleCoilsRequest();
          }
          writeMultipleCoilsRequest.setUnitID(unitId);
          writeMultipleCoilsRequest.setReference(ref);
          writeMultipleCoilsRequest.setCoils(coils);
          transaction.setRequest(writeMultipleCoilsRequest);
          transaction.execute();
      }
docs: Writes a given number of coil states to the slave.
  
  Note that the number of coils to be written is given
  implicitly, through {@link BitVector#size()}.
  
  @param unitId the slave unit id.
  @param ref    the offset of the coil to start writing to.
  @param coils  a <tt>BitVector</tt> which holds the coil states to be written.
  
  @throws ModbusException if an I/O error, a slave exception or
  a transaction error occurs.