• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. fabou3377
    3. Posts

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website
    F
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 7
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by fabou3377

    • IP Parameters, Encapuled or Not? Role of transaction ID?

      Hi,

      I just want understand what's the difference of the field encapsulated of IpParameters

      Here the source code

      
        // Wrap the modbus request in a ip request.
              OutgoingRequestMessage ipRequest;
              if (ipParameters.isEncapsulated())
                  ipRequest = new EncapMessageRequest(request);
              else
                  ipRequest = new XaMessageRequest(request, getNextTransactionId());
      
      

      I work with a plc wago with the UdpMaster.

      Thanks

      posted in Modbus4J general discussion
      F
      fabou3377
    • RE: IP Parameters, Encapuled or Not? Role of transaction ID?

      Hi,

      I just want understand what's the difference of the field encapsulated of IpParameters

      Here the source code

      
        // Wrap the modbus request in a ip request.
              OutgoingRequestMessage ipRequest;
              if (ipParameters.isEncapsulated())
                  ipRequest = new EncapMessageRequest(request);
              else
                  ipRequest = new XaMessageRequest(request, getNextTransactionId());
      
      

      I work with a plc wago with the UdpMaster.

      Thanks

      posted in Modbus4J general discussion
      F
      fabou3377
    • RE: Modbu4J, Help for read register

      Thanks!

      posted in Modbus4J general discussion
      F
      fabou3377
    • RE: Modbu4J, Help for read register

      Ok its works..
      my code :

      public static void main(String[] args) {
             
                  ModbusFactory m = new ModbusFactory();
                  IpParameters ip = new IpParameters();
                  ip.setHost("192.168.10.2");
                  ip.setPort(502);
                  ModbusMaster mp = m.createUdpMaster(ip);
              try {
                  mp.init();
                  ModbusRequest req = new WriteRegisterRequest(1,0,1800);
                  mp.send(req);
                  ModbusRequest req2 = new ReadHoldingRegistersRequest(1,0,1);
                  ReadResponse rep = (ReadResponse) mp.send(req2);
                  System.out.println(rep.getShortData()[0]);
                  
              } catch (Exception ex) {
                  Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
              }
            
          }
      

      in my classpath:
      axis.jar
      bacnet.jar
      modbus4j.jar
      RTXXcomm.jar
      serioUtil.jar

      All this library are necessary?

      It's not possible to get direct the value short double string? In the good typage?

      Thanks four your help and for your job, it's great and its works under windows and linux, before I've tried UDP under linux with jamod and there is serious problems..

      It's should be very interessant if the necessary library are of sourceforge.net..

      For the novice, a little tutorial should be nice..

      posted in Modbus4J general discussion
      F
      fabou3377
    • RE: Modbu4J, Help for read register

      Here my code:

      
         public static void main(String[] args) {
             
                  ModbusFactory m = new ModbusFactory();
                  IpParameters ip = new IpParameters();
                  ip.setHost("127.0.0.1");
                  ip.setPort(502);
                  ModbusMaster mp = m.createTcpMaster(ip, false);
              try {
                  mp.init();
                  ModbusRequest req = new ReadInputRegistersRequest(1, 0, 1);
                  ReadInputRegistersResponse rep = (ReadInputRegistersResponse) mp.send(req);
                  System.out.println(rep.getData());
      
              } catch (Exception ex) {
                  Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
              }
            
          }
      
      
      

      I've this exception:

      
      
      Exception in thread "main" java.lang.NoSuchMethodError: com.serotonin.io.messaging.StreamTransport.<init>(Ljava/io/InputStream;Ljava/io/OutputStream;)V
              at com.serotonin.modbus4j.ip.tcp.TcpMaster.openConnection(TcpMaster.java:113)
              at com.serotonin.modbus4j.ip.tcp.TcpMaster.send(TcpMaster.java:62)
              at javaapplication6.Main.main(Main.java:45)
      
      
      
      
      

      Thanks for your furture help

      posted in Modbus4J general discussion
      F
      fabou3377
    • Modbu4J, Help for read register

      Hi,
      thanks for your library.. Have you an sample to read a marker (word) in a plc?
      Thanks

      posted in Modbus4J general discussion
      F
      fabou3377
    • RE: Modbu4J, Help for read register

      Hi,
      thanks for your library.. Have you an sample to read a marker (word) in a plc?
      Thanks

      posted in Modbus4J general discussion
      F
      fabou3377