Package net.wimpi.modbus

Examples of net.wimpi.modbus.ModbusIOException


    if (!m_Terminal.isActive()) {
      try {
        m_Terminal.activate();
        m_IO = m_Terminal.getModbusTransport();
      } catch (Exception ex) {
        throw new ModbusIOException("Activation failed.");

      }
    }

    //3. Retry transaction m_Retries times, in case of
View Full Code Here


        lastRequest = new byte[len];
        System.arraycopy(buf, 0, lastRequest, 0, len);
      }

    } catch (Exception ex) {
      throw new ModbusIOException("I/O failed to write");
    }

  }//writeMessage
View Full Code Here

      } while (!done);
      return response;
    } catch (Exception ex) {
      System.err.println("Last request: " + ModbusUtil.toHex(lastRequest));
      System.err.println(ex.getMessage());
      throw new ModbusIOException("I/O exception - failed to read");
    }
  }//readResponse
View Full Code Here

          // read back the echoed message
          readEcho(len + 3);
        }
      }
    } catch (Exception ex) {
      throw new ModbusIOException("I/O failed to write");
    }
  }//writeMessage
View Full Code Here

        done = true;
      } while (!done);
      return request;
    } catch (Exception ex) {
      if(Modbus.debug) System.out.println(ex.getMessage());
      throw new ModbusIOException("I/O exception - failed to read.");
    }

  }//readRequest
View Full Code Here

        done = true;
      } while (!done);
      return response;
    } catch (Exception ex) {
      if(Modbus.debug) System.out.println(ex.getMessage());
      throw new ModbusIOException("I/O exception - failed to read.");
    }
  }//readResponse
View Full Code Here

        lastRequest = new byte[len];
        System.arraycopy(buf, 0, lastRequest, 0, len);
      }

    } catch (Exception ex) {
      throw new ModbusIOException("I/O failed to write");
    }

  }//writeMessage
View Full Code Here

      } while (!done);
      return response;
    } catch (Exception ex) {
      System.err.println("Last request: " + ModbusUtil.toHex(lastRequest));
      System.err.println(ex.getMessage());
      throw new ModbusIOException("I/O exception - failed to read");
    }
  }//readResponse
View Full Code Here

          // read back the echoed message
         // readEcho(len + 3);
        }
      }
    } catch (Exception ex) {
      throw new ModbusIOException("I/O failed to write");
    }
  }//writeMessage
View Full Code Here

        done = true;
      } while (!done);
      return request;
    } catch (Exception ex) {
      if(Modbus.debug) System.out.println(ex.getMessage());
      throw new ModbusIOException("I/O exception - failed to read.");
    }

  }//readRequest
View Full Code Here

TOP

Related Classes of net.wimpi.modbus.ModbusIOException

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.