• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. hocragekey

    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
    H
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    hocragekey

    @hocragekey

    0
    Reputation
    308
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    hocragekey Unfollow Follow

    Latest posts made by hocragekey

    • The read is timiing out

      Here is the code for the following info we need to pull

      ModbusFactory factory = new ModbusFactory();
      IpParameters params = new IpParameters();
      params.setHost("192.168.1.100");
      params.setPort(502);
      params.setEncapsulated(true);
      ModbusMaster master = factory.createTcpMaster(params, false);
      // master.setRetries(4);
      master.setTimeout(50000);
      master.setRetries(5);

      		long start = System.currentTimeMillis();
      		try {
      			master.init();
      			for (int i = 0; i < 40; i++) {
      				System.out.println(master.getValue(100,
      						RegisterRange.COIL_STATUS, 100+i,
      						DataType.BINARY));
      			}
      		} catch (Exception e) {
      			e.printStackTrace();
      		} finally {
      			master.destroy();
      		}
      
      		System.out.println("Took: " + (System.currentTimeMillis() - start)
      				+ "ms");
      

      We are trying to pull the values from the following information

      Slave ID: 100
      Function: 01 Read Coils (0x)
      Address: 100
      Quantity: 40

      This works on another program we downloaded just to see if the PLC was ok and the PLC is working. Whenever we try with Modbus4j it times out. Any help is appreciated!

      posted in Modbus4J general discussion
      H
      hocragekey
    • RE: The read is timiing out

      Here is the code for the following info we need to pull

      ModbusFactory factory = new ModbusFactory();
      IpParameters params = new IpParameters();
      params.setHost("192.168.1.100");
      params.setPort(502);
      params.setEncapsulated(true);
      ModbusMaster master = factory.createTcpMaster(params, false);
      // master.setRetries(4);
      master.setTimeout(50000);
      master.setRetries(5);

      		long start = System.currentTimeMillis();
      		try {
      			master.init();
      			for (int i = 0; i < 40; i++) {
      				System.out.println(master.getValue(100,
      						RegisterRange.COIL_STATUS, 100+i,
      						DataType.BINARY));
      			}
      		} catch (Exception e) {
      			e.printStackTrace();
      		} finally {
      			master.destroy();
      		}
      
      		System.out.println("Took: " + (System.currentTimeMillis() - start)
      				+ "ms");
      

      We are trying to pull the values from the following information

      Slave ID: 100
      Function: 01 Read Coils (0x)
      Address: 100
      Quantity: 40

      This works on another program we downloaded just to see if the PLC was ok and the PLC is working. Whenever we try with Modbus4j it times out. Any help is appreciated!

      posted in Modbus4J general discussion
      H
      hocragekey