digitalpetri/modbus

How to set the slave address when sending a command

liusishan opened this issue · 2 comments

Hello, how to modify the slave address when sending commands.

Is it the unitId parameter of this method? I used the Modbus Slave simulation software to simulate a slave station, the address is 1, and the parameter unitId is the data obtained from slave station 1 no matter what value is passed.

public <T extends ModbusResponse> CompletableFuture<T> sendRequest(ModbusRequest request, int unitId) {
}

Yes, it’s the unitId parameter.