-
Notifications
You must be signed in to change notification settings - Fork 137
2.4 Concrete Protocol Layer ProtocolLinker
Concrete Protocol Layer means a protocol with full implemetations, like Modbus Rtu. Modbus Rtu extends CRC16 and byte[] linear combination from Modbus common core, using serial port.
After receving SendReceive message from IProtocol, IProtocolLinker will found SpecialProtocolUnitAttribute in ProtocolUnit.
If sure, ProtocolUnit will directory translate the message and send it to IConnector.
Then run CheckRight to check the response message from IConnector, and return it to IProtocol.
If not, ProtocolUnit will translate the message, then reflect and create its ProtocolLinkerBytesExtend, run BytesExtend in this ProtocolLinkerBytesExtend instance to extend message. At the end send message to IConnector.
When receving, it will run CheckRight first to check response, and run BytesDecact in ProtocolLinkerBytesExtend to decact message to protocol core. Finally return it to IProtocol.
You need to name AProtocolLinkerBytesExtend for AProtocolLinker because of the reflection rule.
IProtocol sends SendMessage to IProtocolLinker, IProtocolLinker sends SendMessage to IConnector.
ProtocolLinker controls the sending methods in contruction and overridable inner methods.
IProtocol sends Connect/Disconnect to IProtocolLinker, IProtocolLinker sends Connect/DisConnect to IConnector.
Modbus.Net Hangzhou Delian Science Technology Co.,Ltd. © 2023
-
2 Specification of Modbus.Net main framework
- 2.1 Modbus.Net Architecture
- 2.2 Transmission Control Layer Controller
- 2.3 Transmission Link Layer Connector
- 2.4 Concrete Protocol Layer ProtocolLinker
- 2.5 Abstract Protocol Layer Protocol
- 2.6 Protocol Presentation Layer Utility
- 2.7 Device Application Layer Machine
- 2.8 Task Application Layer MachineJob
-
3 Using Modbus.Net to implement a protocol
- 3.1 Global Tools
- 3.2 Extends Protocol and ProtocolUnit according to protocol specification
- 3.3 Extends Connector to create a link method
- 3.4 Extends Machine and Utility, creating two apis
- 3.5 Extends API methods to Machine and Utility
- 3.6 Extends Formater, Translator and Combiner, Creating Encoding,Decoding,Combining methods for address
- 3.7 Extends Controller, to control message