Repository navigation
3.2 Extends Protocal and ProtocalUnit according to protocol specification
parallelbgls edited this page Jun 29, 2017
·
1 revision
Steps of extending a protocol transmission layer:
-
Extends IProtocalFormatting or ProtocalUnit, implementing protocol common core
- Inherit InputStruct, implementing input class of a protocol.
- Inherit OutputStruct, implement output class of a protocol.
- Inherit ProtoalUnit, implementing Format for translate Inputstruct into input parameter(Connector use) and Unformat for translate output parameter to OutputStruct(Connector use).
- If SpecialProtocalUnitAttribute([SpecialProtocalUnit]) is put below ProtocalUnit, that ProtocoolUnit would not run BytesExtend and BytesDecact.
- Caution, multiple ProtocalUnits is required for different protocol contents in a protocal specification.
-
Extends IProtocal or BaseProtocal,implementing host class for a protocol specification.
- You should impletent each Protocal for each specification and point its ProtocalLinker. For example ModbusRtuProtocal loaded ModbusRtuProtocalLinker and ModbusTcpProtocal loaded ModbusTcpProtocalLinker.
-
Extends ProtocalLinker, implementing the concrete protocol.
- Creates A class inherit ProtocalLinkerBytesExtend and name it depending on ProtocalLinker. Then Implement BytesExtend and BytesDecact for extending a common core to a concrete protocol.
- Extends ProtocalLinker, there are two existing ProtocalLinkers called ComProtocalLinker and TcpProtocalLinker, you can inherit from each or implement your own base ProtocalLinker based on connection hardware type, both on ProtocalLinker and Connector.
- Override CheckRight in ProtocalLinker, check if the reponse message is correct.
Modbus.Net © 2016-2026 Hangzhou Delian Science Technology Co.,Ltd. | Licensed under MIT
- 1-概要介绍
- 2-Modbus.Net主体框架规范
- 3-利用Modbus.Net实现一个协议
- 4-使用Modbus.Net
- 5-Modbus.Net.Modbus
- 6-Modbus.Net.Siemens
- 7-Modbus.Net.HJ212
- 8-调试与Issue提交
- 1-Overview
-
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
- 4-Using Modbus.Net
- 5-Modbus.Net.Modbus
- 6-Modbus.Net.Siemens
- 7-Modbus.Net.HJ212
- 8-Debug method and issue upload