User Activity

  • Posted a comment on discussion Open Discussion on Java Modbus Library

    I don't have an example, but it should work to open the connection first and close it at the end when finished. In the loop do read and display the output. If your goal is to have 1 sec output you should set a timer event for 1sec to update the output. Here is an example of a timer thread but you can do your own google search to find other examples: https://stackoverflow.com/questions/9413656/how-to-use-timer-class-to-call-a-method-do-something-reset-timer-repeat?newreg=0d9fcf1d977f487f8c72bc2ee...

  • Posted a comment on discussion Open Discussion on Java Modbus Library

    You can try to reduce your sleep time so that the read operation is able to work more frequently. As long as you have some sleep time in the loop it will prevent it from spinning and using up all of the processor time. Also you probably want to open the TCP socket in a separate method and leave it open for the duration rather than reconnecting every second. That is probably where all the extra time is going. John

View All

Personal Data

Username:
jdcharlton
Joined:
2002-01-16 02:58:00

Projects

This is a list of open source software projects that John D Charlton is associated with:

Personal Tools