Skip to content

8 Debug method and issue upload

luosheng edited this page Jun 7, 2023 · 2 revisions

Debug Method

Modbus.Net directly using Serilog with no LoggerFactory. The reason is that this framework has a task shut down bug in web application caused by web GC.
BackgroundTask in Asp.net BoilerPlate can fix this bug.

If you want to use serilog to output log please add a initialize code at the beginning of codes. Check Serilog Configuration Basics.

The meaning of serilog level for Modbus.Net:

Level Usage
Debug All Debug messages.
Information Connect, Disconnect and all status change.
Warning All problem that will not cause shutdown or throws exception.
Error All problem that will cause shutdown or throws exception.
Fatal Print when application crashed.(Users should define himself/herself)

issue upload

Modbus.Net may has bugs. This is caused by imbedded devices, serial ports and Administrations, so it cannot be tested automatically.
And protocol documents itself may not complexable, so I will not promise the correction of the implementation.

Before 1.3.2

Use WireShark2 or Comspy. Describe is issue the print all related messages.

After 1.3.9 Set Serilog level to Verbose, output to a file, describe the issue and print all of them to issue.

Diagnotics for serial port.

.NET has lack capibility with serial port, diagnotics is also hard. If you cannot open serial correctly or throw exceptions, one or some of the following reasons would happen.

  1. Slave or master wrong. (No response)
  2. Serial port singal interfere. (Wrong codes or no response)
  3. Message sends wrong. (Throw exception)
  4. Chip on serial port line or exchange line burned.(Wrong codes when sending)
  5. Serial Port No. wrong or not detected.(Open failed)

Home

Clone this wiki locally