Hi guys,
First, I'd like to say I've found the modbus4j libraries an awesome tool and thank you for allowing this to be open source. Also, I'm a bit new to Java programming so I admit my comprehension of error handling is not the best. Now that being said, I have an application where I would really like to get some guidance.
The application is simple, main class creates a simple GUI with a Swing JFrame and extends two threads. First thread updates the GUI, second thread polls the modbus registers. Now everything works perfectly fine, but after the GUI runs a bit I begin getting a lot of these exceptions:
com.serotonin.messaging.WaitingRoomException: No recipient was found waiting for response for key com.serotonin.modbus4j.ip.xa.XaWaitingRoomKey@8ea
at com.serotonin.messaging.WaitingRoom.response(WaitingRoom.java:69)
at com.serotonin.messaging.MessageControl.data(MessageControl.java:153)
at com.serotonin.messaging.InputStreamListener.run(InputStreamListener.java:76)
at java.lang.Thread.run(Thread.java:745)
The ModbusMaster functions in the polling thread are the only methods that call the com.serotonin libraries, so it must be from that. The thread is very simple, when it is first called it creates the ModbusFactory, then the ModbusTCIPMaster, and then initializes the modbus locations for all the registers I'm polling. After that it enters a continuous loop with a sleep command to control the polling rate, see below:
public void run() {
System.out.println(threadName + " thread started");
this.t.setPriority(5);
I cut a lot out to reduce the verbosity, but as far as I can tell ModbusMaster.getValue only throws "ModbusTransportException" and "ErrorResponseException", how am I missing the exception?
Also, any help is always appreciated :) Thanks