Open Zoneee opened 2 years ago
Hi Zoneee, could you please shortly descibe what AOP is? Do you have a link where it is documented?
What dies AOP stand for? I cannot find anything Ehen I search for "AOP Modbus". Thanks :-)
Hi,Apollo3zehn,For AOP please refer to:
I use AOP more for logging. As for server.RegistersChanged&server.CoilsChanged
Hi,Apollo3zehn,For AOP please refer to:
- https://en.wikipedia.org/wiki/Attribute-oriented_programminghttps://en.wikipedia.org/wiki/Attribute-oriented_programming
- https://en.wikipedia.org/wiki/Aspect-oriented_programminghttps://en.wikipedia.org/wiki/Aspect-oriented_programming
I use AOP more for logging. As for server.RegistersChanged&server.CoilsChanged
Oh, I forgot to mention that it is the "Modbus Client" that requires AOP functionality. Or maybe there already is? What did I miss?
I am new to AOP but from what I have read here (https://docs.microsoft.com/en-us/archive/msdn-magazine/2014/february/aspect-oriented-programming-aspect-oriented-programming-with-the-realproxy-class) you can implement it yourself without the need to change Fluentmodbus - except that I think you need an interface class, like an IModbusTcpClient
. If that is really all you need I can add these interfaces.
Hello, SORRY for the late reply.
I read the article carefully, and the "aspect-oriented Programming with the RealProxy Class" approach is a good one, but it's a little too complicated.
Inheriting the RealProxy
approach results in adding a new RealProxy
that either changes the factory or the consumer knows which RealProxy
is really needed.
I didn't understand how to solve the problem by adding IModbusTcpClient
.
I think I can write a simple example of what I need, right
As shown in the following table, this is my understanding of the message format sent by the client and server of Modbus-RTU. I want to log in the same format as the table below
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
| pcb | command | address | data | CRC -- | -- | -- | -- | -- | -- length | 1byte | 1byte | 2bytes | 2bytes | 2bytes example | 01 | 06 | 00 | 01 | 00 | 32 | A8 | 3D
Hello author, I am an Asian with poor English, all the following content is from machine translation. I am new to Modbus and would like the author to add AOP functionality, which would be useful to check if the commands are correct. Or please tell me how to add AOP, I think I can do the job.