Package net.wimpi.modbus.msg

Examples of net.wimpi.modbus.msg.ReadCoilsResponse


        ModbusRequest request = new ReadCoilsRequest(getStart(), getLength());
        if (this instanceof ModbusSerialSlave) {
          request.setHeadless();
        }
        request.setUnitID(id);
        ReadCoilsResponse responce = (ReadCoilsResponse) getModbusData(request);
        local = responce.getCoils();
      } else if (ModbusBindingProvider.TYPE_DISCRETE.equals(getType())) {
        ModbusRequest request = new ReadInputDiscretesRequest(getStart(), getLength());
        ReadInputDiscretesResponse responce = (ReadInputDiscretesResponse) getModbusData(request);
        local = responce.getDiscretes();
      } else if (ModbusBindingProvider.TYPE_HOLDING.equals(getType())) {
        ModbusRequest request = new ReadMultipleRegistersRequest(getStart(), getLength());
        ReadMultipleRegistersResponse responce = (ReadMultipleRegistersResponse) getModbusData(request);
        local = responce.getRegisters();
      } else if (ModbusBindingProvider.TYPE_INPUT.equals(getType())) {
        ModbusRequest request = new ReadInputRegistersRequest(getStart(), getLength());
        ReadInputRegistersResponse responce = (ReadInputRegistersResponse) getModbusData(request);
        local = responce.getRegisters();
      }
      if (storage == null)
        storage = local;
      else {
        synchronized(storage) {
View Full Code Here

TOP

Related Classes of net.wimpi.modbus.msg.ReadCoilsResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.