ed-chemnitz / qmodbus

GNU General Public License v2.0
280 stars 127 forks source link

ModBus requests/responses #39

Open tibarbosa opened 1 year ago

tibarbosa commented 1 year ago

CRC is not being properly displayed on this section.

At Raw data we can see the CRC for a request, but on the "ModBus requests/responses" section the CRC appears to be as "0000" (always).

image

tibarbosa commented 1 year ago

Suggestion

As as temporarily measure, change "check_confirmation" function of file "modbus.c":

if (ctx->monitor_add_item) {
        ctx->monitor_add_item(ctx, 1,
                req[offset - 1],  /* slave */
                function,  /* func */
                ( req[offset + 1] << 8 ) + req[offset + 2], /* addr */
                ( req[offset + 3] << 8 ) + req[offset + 4], /* nb */
                (req[offset + 5] << 8) + req[offset + 6], (req[offset + 5] << 8) + req[offset + 6]); /* crc */
    }