Author Topic: Bad Checksum Error  (Read 2223 times)

MikeF

  • Newbie
  • *
  • Posts: 10
    • View Profile
Bad Checksum Error
« on: March 17, 2017, 10:04:57 PM »
Hello, I'm new to Advanced HMI and I am trying to establish Modbus RTU connection with a Click PLC using a USB to RS-232 Adapter.

I have setup a ModbusRTUCom with the same settings as the Click. At the moment I am trying to validate connection by using a basic label with PLCAddressKeyad and PLCAddressValue set to 40001. When I run the program, the text of the basic label changes to "Bad Checksum".  Same result with other elements as well.

Any input on how I should go about troubleshooting?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Bad Checksum Error
« Reply #1 on: March 17, 2017, 10:16:36 PM »
Sounds like you may have a com setting mismatch, such as baud rate or parity.

Also did you completely close your programming software to make sure AdvancedHMI can get access to the Com port?

MikeF

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Bad Checksum Error
« Reply #2 on: March 23, 2017, 04:38:03 PM »
Archie,

I have been fiddling with this now for a while with no progress. Baud Rate, Data Bits, Parity, and stop bits are all the same in the ModbusRTUcom1, the com port settings in the click, and device manager. I have tried a couple different combinations and it still says bad checksum.

The click PLC programming software is closed and the PLC is in run mode. Anything else I can try?

Here are my current comm settings:

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Bad Checksum Error
« Reply #3 on: March 23, 2017, 06:40:44 PM »
The next thing to try is to set the EnableLogging property on all of your drivers to True, then run the application for a short period of time. Then post the log file that is created in the \bin\debug directory.

MikeF

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Bad Checksum Error
« Reply #4 on: March 23, 2017, 11:09:24 PM »
Attached is the driver Log,

There was also a document named DriverErrorLog.txt that was filled with:

Code: [Select]
SendQueProcessor-Cannot access a disposed object.
Object name: 'ModbusRTU DLL is disposed'.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Bad Checksum Error
« Reply #5 on: March 23, 2017, 11:30:25 PM »
The actual error code being returned is Illegal Data Address (code 2). Then randomly data comes from the device with a function code 16 although AdvancedHMI isn't requesting it. Do you have anything in your PLC program that would tell it to write to a Modbus device?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Bad Checksum Error
« Reply #6 on: March 24, 2017, 12:58:27 AM »
Edit to what I previously stated.... The response to the requests are correct. It is returning a value of 13312 for register 40001

The problem comes from the packet:

1,16,112,0,0,2,4,117,72,66,60

This packets comes from the PLC without it being requested. It seems the PLC wants to send a write command (function code 16) to registers 428673 and 42674. With values 30024 and 16956. The second problem is the request is not showing a checksum, therefore you are seeing the bad checksum error.

Do you have anything in your PLC program that is trying to write to a Modbus device? I would try with a new program that is completely empty (no rungs) and try again.

MikeF

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Bad Checksum Error
« Reply #7 on: March 24, 2017, 12:39:01 PM »
That did it. I misunderstood how to setup the system and had the PLC trying to write to Advanced HMI.
Bad checksum error is gone.

Thanks Archie!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Bad Checksum Error
« Reply #8 on: March 24, 2017, 12:41:36 PM »
Be sure to set EnableLogging back to False, otherwise you will get an endlessly growing log file.