AdvancedHMI Software

General Category => Support Questions => Topic started by: iamjer76 on July 10, 2015, 04:48:18 PM

Title: Modbus TCP - No Response from PLC(21)
Post by: iamjer76 on July 10, 2015, 04:48:18 PM
I am using version 3.98 and am building a new project to connect to a Trio PLC using Modbus TCP. When I test it out, my basic labels will flash the value I expect them to from the Trio PLC and then they will flash "No Response From PLC(21). This continues and never seems to stop. Please advise.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Archie on July 10, 2015, 05:37:55 PM
Are you using 3.98t?  If so, try version 3.98s. Version t had some changes that may have affected the Modbus driver and it was not tested.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: iamjer76 on July 11, 2015, 01:40:51 PM
I am using the 3.98t. Is there a process to replace the 3.98t with the 3.98s or can I just copy over the AdvancedHMI drivers folder in my project with the 3.98s folder?
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Archie on July 11, 2015, 01:49:49 PM
There are probably some driver incompatibilities that will not let it copy directly.

You may be able to download and extract version 3.98s, then copy your AdvancedHMI project folder from your version 3.98t

If not you will need to open version 3.98s, then right click the AdvancedHMI project in Solution explorer, then select Add Existing Item and browse to the .vb files for each of your forms. Be sure to only do one form at a time.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: iamjer76 on July 11, 2015, 02:13:52 PM
Ok, so I was able to just copy my project into the 3.98s folder and launch it, but I get the same results. Shows the values and then flashes to No Response from PLC(21) and back to the values. It shows the values for roughly half a second and then no response message for 5 seconds.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Godra on July 11, 2015, 03:14:18 PM
I am not an expert for Modbus but the driver works fine with MOD RSSIM Simulator (which just simulates a device).

In your case it could be some setting that's wrong, maybe PollRateOverride or other, or it could be communication issue unless it can be proved as working with another program.

Just guessing.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Archie on July 11, 2015, 03:17:11 PM
The best tool for troubled shooting Ethernet communications is WireShark. If you start Wireshark, then start AdvancedHMI, let it run for about 30 seconds. Then save the file and post it here.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: iamjer76 on July 11, 2015, 04:08:57 PM
Attached you will find the wireshark capture for this issue.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Archie on July 11, 2015, 04:29:36 PM
Everything looks normal

I see a read of two 16 bit integers start at address 40381 followed by a response 104ms later

Then a read of 76 registers starting at 40363 followed by a response 87ms later

Does this sound right?
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: iamjer76 on July 11, 2015, 04:45:37 PM
That isn't quite right. I will be reading a lot of tags, but right now I should only be reading two registers 40363 and 40381. I'm not exactly sure how the 76 registers came into play. I only have the specific register specified in each of my two BasicLabels.

Ultimately, this is the initial connection test to begin building everything else. It just doesn't seem to be reacting as I would expect.

Does it make a new connection each time it reads? I do know the Trio PLC only accepts 2 total connections and the machine to be controlled is using 1. If this is connecting each time it reads, it may be overloading the available connections. Not sure if that's the case, just curious.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Archie on July 11, 2015, 04:52:21 PM
It only opens one connection and keeps it open until there is a communication failure or the application closes.

I will do a test with the 2 addresses you are using. What is supposed to be happening is that it will read each address individually, then read then both in a single packet from there on. So the driver should be reading 18 registers starting at 30363. I will do some tests to see if I can figure out why the driver is doing what it is.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: iamjer76 on July 11, 2015, 04:54:09 PM
Thank you. I can't tell you how much this is appreciated.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Archie on July 11, 2015, 10:03:01 PM
I tested this out using version 3.98t, but I seem to be getting different results. This is what I did:

- Added ModbusTCPCom to the form
- Set the IPAddress
- Added a BasicLabel to the form and set the PLCAddressValue to 40363
- Added a 2nd BasicLabel and set the PLCAddressValue to 40381

When I run the app and watch the communication, it reads 19 registers starting at 40363.

Does this sound like I am doing the same thing you are?
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Godra on July 11, 2015, 11:26:56 PM
I just created the same setup, reading over network from MOD RSSIM server on another computer, both labels show correct values for each of the 2 registers (40363 and 40381) and Wireshark capture shows word count as 19.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Archie on July 12, 2015, 07:04:57 AM
Do you possibly have another program running at the same time that may be also communicating to the PLC, such as the PLC programming software?
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: iamjer76 on July 12, 2015, 10:46:10 AM
The machine touchscreen also communicates to the PLC, but that is it. The PLC can accept 2 connections at once so this shouldn't be an issue as it still leaves a connection for this project.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Godra on July 12, 2015, 04:51:59 PM
You can always do a quick test by temporarily disconnecting the touchscreen.

That way you would eliminate the touchscreen as possible cause.
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: Archie on July 12, 2015, 05:38:59 PM
Both Godra and myself are getting the same results with our tests, so we first have to figure why you are getting something different to make sure I am looking at the correct Wireshark information. The only thing I can think of is maybe the test you ran was on 3.98s and our test was on 3.98t. Can you run the same test on 3.98t and do another WireShark capture?

Is it possible that you have another software on your PC running in the background such as an OPC server that may be communicating with your controller?
Title: Re: Modbus TCP - No Response from PLC(21)
Post by: iamjer76 on July 12, 2015, 10:52:28 PM
This is now working! I don't have a reason as to why aside from the fact that I rebooted my computer. Thank you all for your time as you have been very helpful and I can't express my gratitude enough.