Closed allon3721 closed 7 years ago
ModbusTcpMasterConfig config = new ModbusTcpMasterConfig.Builder("localhost").build(); ModbusTcpMaster master = new ModbusTcpMaster(config);
CompletableFuture<ReadCoilsResponse> future = master.sendRequest(new ReadCoilsRequest(0, 2), 0);
future.thenAccept(response -> { ByteBuf coilStatus = response.getCoilStatus();
ReferenceCountUtil.release(response);
});
IllegalFunction typically means whatever slave you're talking to hasn't implemented the function code you're trying to use.
IllegalFunction
ModbusTcpMasterConfig config = new ModbusTcpMasterConfig.Builder("localhost").build(); ModbusTcpMaster master = new ModbusTcpMaster(config);
future.thenAccept(response -> { ByteBuf coilStatus = response.getCoilStatus();
});