hafidz1977 / pymodbus

Automatically exported from code.google.com/p/pymodbus
0 stars 0 forks source link

Handling of "Force Listen ModeOnly" diagnostic messages #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The diagnostic message "Force Listen Only Mode" does not
return a response, according to the specification (page 81).
But there is a class ForceListenOnlyModeResponse.

Would it make sense to remove this class? It is instantiated
by ForceListenOnlyModeRequest - so this might even be a bug :-).

Please check and adapt pymodbus/diag_message.py, if necessary.

Thanks, Albert

Original issue reported on code.google.com by albert.k...@gmail.com on 23 Feb 2011 at 11:39

GoogleCodeExporter commented 9 years ago
That should have been "Force Listen Only Mode" in the subject... -
hit the return key while trying to modify the subject :-(

Original comment by albert.k...@gmail.com on 23 Feb 2011 at 11:39

GoogleCodeExporter commented 9 years ago
Well you are right; I added the response just because the rest of the code kind 
of expects it. I guess I could add a flag in the pdu for "respond" or just make 
the requests that don't respond return None and have the server code test the 
result before they send "if result != None: send(result)"

Original comment by Bashw...@gmail.com on 23 Feb 2011 at 9:15

GoogleCodeExporter commented 9 years ago
> I guess I could add a flag in the pdu for "respond" or just make the
> requests that don't respond return None and have the server code test
> the result before they send "if result != None: send(result)"

I'd prefer a flag, since it is more explicit and less error prone. It
might happen that the result is None due to a programming error. In
this case, the result would just be silently ignored - an error that is
hard to detect.

Maybe it would be better to call the flag "send_response", since it
cannot be confused with "response" and corresponds more closely to
the meaning of the flag; but this is a matter of taste ;-).

Regards, Albert

Original comment by albert.k...@gmail.com on 2 Mar 2011 at 8:30

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r131.

Original comment by Bashw...@gmail.com on 2 Mar 2011 at 3:21