me.martiii.modbustcpjava.protocol.requests.ReadRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of modbus-tcp-java Show documentation
Show all versions of modbus-tcp-java Show documentation
Modbus-TCP protocol for java.
The newest version!
package me.martiii.modbustcpjava.protocol.requests;
import me.martiii.modbustcpjava.protocol.ModbusRequest;
public class ReadRequest extends ModbusRequest {
public ReadRequest(byte functionCode, int addressFirstRegister, int numberRegisters) {
super(functionCode);
data = new byte[4];
data[0] = (byte) (addressFirstRegister >>> 8);
data[1] = (byte) addressFirstRegister;
data[2] = (byte) (numberRegisters >>> 8);
data[3] = (byte) numberRegisters;
}
}