CRC error on RTU response doesn't return negative value

Bug #378981 reported by Stéphane Raimbault
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libmodbus
Fix Released
High
Stéphane Raimbault

Bug Description

Hi (this is my first post hero on launchpad, hope I post in right place)

I have libmodbus 2.0.3 and some problems with CRC errors. I'm writing a modbus Master that communicate with RTU slaves over RS485.
When I issue a

"modbus_ret = read_holding_registers(&mb_param,id_slave,(start_addr-1),qty,tab_rp_registers);"

and the return has invalid CRC, libmodbus prompts as it should with

"ERROR Invalid crc received E800 - crc_calc 4716 (-16)" , for example.

But, the return value from read_holding_registers is 1, not -16, indicating a GOOD answer from slave and messing up my Masters registers. And yes, the modbus_ret is signed.

This must be a bug, right?

Regards
Henrik

Related branches

Revision history for this message
Stéphane Raimbault (sra) wrote :

revno: 174
committer: Stéphane Raimbault <email address hidden>
branch nick: libmodbus
timestamp: Thu 2009-05-21 11:55:36 +0200
message:
  Fix #378981 - CRC error on RTU response doesn't return negative value
  Reported by Henrik Munktell.

Changed in libmodbus:
assignee: nobody → Stéphane Raimbault (sra)
importance: Undecided → High
milestone: none → 2.2.0
status: New → Fix Committed
Changed in libmodbus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.