All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.martiii.modbustcpjava.protocol.requests.ReadRequest Maven / Gradle / Ivy

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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy