• Recent
    • Tags
    • Popular
    • Register
    • Login

    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

    Modbus4j the best way for do a polling

    Modbus4J general discussion
    2
    3
    2.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ramonhlR
      ramonhl
      last edited by

      I am developing an Android application to read/write Modbus TCP variables in some PLC.
      In this moment I read/write variables using the function ReadHoldingRegisters/WriteHoldingRegisters.

      master.init()--> ReadHoldingRegisters or WriteHoldingRegisters --> master.destroy();

      My question is:

      If I want read the registers every second, What is the best way to do it? make 1 sec timer and read every second?
      Can I use other modbus4j function to do this?

      Thanks, best regards.

      1 Reply Last reply Reply Quote 0
      • M
        mlohbihler
        last edited by

        Modbus4J does not have any internal polling mechanisms, no. In Android it would probably be best to create a service that does the polling at the desired rate. If polling, as you say, once per second you should, of course, not be initializing and destroying each time.

        Best regards,
        Matthew

        1 Reply Last reply Reply Quote 0
        • First post
          Last post