Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unit ID of MODBUS response is ignored?
#1
It seems that Virtuino is ignoring the Unit ID in the MBAP header of a MODBUS response?

I have 2 units in a MODBUS connection that share some of the same value addresses. However, when Virtuino is unable to read these values from one of the units (e.g. due to some network or hardware failure), it has some probability to read them from a response returned by the other unit containing the same address (but maybe even with a different function code).

If I disable or remove the faulty unit from the MODBUS connection, keeping the other one reading data properly, and then modify the server-side code to hard-code the Unit ID in the response to a different value, but Virtuino could still read the data!

This makes a MODBUS connection with multiple units very unstable. Hope this problem can be solved, thanks.
Reply
#2
Hi,
this is a very interesting issue. 
I want to check it, but it is not so easy.
Go to the Modbus Connection settings. Is the checkbox "Permanent connection" checked? 
Change the state of this checkbox. Then try again.
Please inform me for the results.
Τhis error should not occur with the option unchecked.
I will try to fix it as soon as it possible.
Reply
#3
Quote:Go to the Modbus Connection settings. Is the checkbox "Permanent connection" checked?
Change the state of this checkbox. Then try again.

Yes, "Permanent connection" is checked. If I uncheck it and try again, as of now, this error has not occurred.
P.S: But "Alternative URL or IP" will no longer work with the option unckecked.

Quote:I want to check it, but id is not so easy.

Is it possible to utilize the Transaction ID? Generate a unique transaction ID for each request, and cache the request until it is timed out. Whenever a response is received, look for a cached request with the same transaction ID, if found and their Unit IDs also match, process the response and complete the request, otherwise, discard the response.
Reply
#4
Thank you for your suggestion!
I will try to fix this issue on on the next update.
I will check the "Alternative url" too.
Reply
#5
Εventually I will have to remove the permanent connection option. There is no other way to fix this bug.
I have fixed the bug about the "Alternative IP or URL".
The changes will be available on the version 0.4.2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)