Package net.wimpi.modbus.procimg

Examples of net.wimpi.modbus.procimg.DigitalOut


    setCoil(b);
  }//constructor
 
  public ModbusResponse createResponse() {
    WriteCoilResponse response = null;
    DigitalOut dout = null;

    //1. get process image
    ProcessImage procimg = ModbusCoupler.getReference().getProcessImage();
    //2. get coil
    try {
      dout = procimg.getDigitalOut(this.getReference());
      //3. set coil
      dout.set(this.getCoil());
      //if(Modbus.debug) System.out.println("set coil ref="+this.getReference()+" state=" + this.getCoil());
    } catch (IllegalAddressException iaex) {
      return createExceptionResponse(Modbus.ILLEGAL_ADDRESS_EXCEPTION);
    }
    response = new WriteCoilResponse(this.getReference(), dout.isSet());
    //transfer header data
    if (!isHeadless()) {
      response.setTransactionID(this.getTransactionID());
      response.setProtocolID(this.getProtocolID());
    } else {
View Full Code Here


    setDataLength(m_Coils.byteSize() + 5);
  }//constructor

  public ModbusResponse createResponse() {
    WriteMultipleCoilsResponse response = null;
    DigitalOut douts[] = null;

    //1. get process image
    ProcessImage procimg = ModbusCoupler.getReference().getProcessImage();
    //2. get coil range
    try {
View Full Code Here

    setCoil(b);
  }//constructor
 
  public ModbusResponse createResponse() {
    WriteCoilResponse response = null;
    DigitalOut dout = null;

    //1. get process image
    ProcessImage procimg = ModbusCoupler.getReference().getProcessImage();
    //2. get coil
    try {
      dout = procimg.getDigitalOut(this.getReference());
      //3. set coil
      dout.set(this.getCoil());
      //if(Modbus.debug) System.out.println("set coil ref="+this.getReference()+" state=" + this.getCoil());
    } catch (IllegalAddressException iaex) {
      return createExceptionResponse(Modbus.ILLEGAL_ADDRESS_EXCEPTION);
    }
    response = new WriteCoilResponse(this.getReference(), dout.isSet());
    //transfer header data
    if (!isHeadless()) {
      response.setTransactionID(this.getTransactionID());
      response.setProtocolID(this.getProtocolID());
    } else {
View Full Code Here

    setDataLength(m_Coils.byteSize() + 5);
  }//constructor

  public ModbusResponse createResponse() {
    WriteMultipleCoilsResponse response = null;
    DigitalOut douts[] = null;

    //1. get process image
    ProcessImage procimg = ModbusCoupler.getReference().getProcessImage();
    //2. get coil range
    try {
View Full Code Here

TOP

Related Classes of net.wimpi.modbus.procimg.DigitalOut

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.