-
Notifications
You must be signed in to change notification settings - Fork 137
8 调试的方法和issue的提交方法
luosheng edited this page Jun 7, 2023
·
4 revisions
Modbus.Net直接使用Serilog,并没有增加LoggerFactory。原因是这个框架基本在网页项目中存在线程资源回收的问题,可能会发生任务中断的情况。
如果要使用Serilog输出日志,请在项目的开头增加Serilog的调用。详见Serilog Configuration Basics。
Serilog 日志等级在Modbus.Net中的含义
等级 | 用途 |
---|---|
Debug |
所有的调试信息。 |
Information |
连接、断开和所有的状态改变的时候。 |
Warning |
不会引起报错,连接断开等异常情况的错误。 |
Error |
会引起报错,连接断开等异常情况的错误。 |
Fatal |
程序崩溃的时候。(需用户自己定义) |
Modbus.Net不保证一定是正确的,因为特殊原因(需要嵌入式设备),我没有办法做到完全自动化的测试。
而且受到嵌入式开发环境的限制,我也不能保证协议本身是正确的。
1.3.2及以前
请使用WireShark2或Comspy抓包,描述错误现象并把报文完整粘贴到issue中。
1.3.9及以后 请配置Serilog的日志等级为诊断(Verbose),配置输出到文件中,然后直接把文件中的文本与本来的正常通讯报文一起粘贴到issue中。
.NET 与串口之间的兼容性并不是特别好,诊断问题的方法较为复杂,如果您的串口无法与设备正常通讯,可能存在以下问题。
- 从站号与主站号错误(通讯发出后没有响应)。
- 串口线出现信号串流或干扰(乱码,设备无响应或抛出异常)。
- 通讯报文错误(程序会抛出异常)。
- 串口线或串口转换线芯片烧毁(乱码)。
- 串口未正确识别或使用了错误的端口(通讯开启时直接失败)。
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