AdvancedHMI Software
General Category => Support Questions => Topic started by: MikeF 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?
-
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?
-
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:
-
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.
-
Attached is the driver Log,
There was also a document named DriverErrorLog.txt that was filled with:
SendQueProcessor-Cannot access a disposed object.
Object name: 'ModbusRTU DLL is disposed'.
-
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?
-
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.
-
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!
-
Be sure to set EnableLogging back to False, otherwise you will get an endlessly growing log file.