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 ( ) ; }
Writes a given number of coil states to the slave .