Code example for BitSet

Methods: set

0
 
    @Test 
    public void testWriteMultipleCoils() throws NoResponseException, ErrorResponseException { 
        int quantityOfCoils = 10;
 
        BitSet coils = new BitSet(quantityOfCoils);
        coils.set(0);
        coils.set(5);
        coils.set(8);
 
        WriteMultipleCoilsResponse writeMultipleCoils = modbusClient.writeMultipleCoils(12321, quantityOfCoils, coils);
 
        assertNotNull(writeMultipleCoils);
 
        System.out.println(writeMultipleCoils);
    } 
 
    @After 
    public void tearDown() throws Exception { 
        modbusClient.close();
Experience pair programming with AI  Get Codota for Java