Author Topic: Read Failed. Path Destination Unknown, Status Code=5  (Read 4453 times)

NicholasArbor

  • Newbie
  • *
  • Posts: 4
    • View Profile
Read Failed. Path Destination Unknown, Status Code=5
« on: October 11, 2017, 11:47:51 PM »
As the title suggests, I keep getting the exception error "Read Failed. Path Destination Unknown,  Status Code=5" when attempting to read a tag from my PLC. The code is simple:

Code: [Select]
            var tagName = "inpHeartbeatRTA_Chroma19020_Bay4";
            var EIP = new EthernetIPforCLXCom();
            EIP.BeginInit();
            EIP.ComError += EIP_ComError;
            EIP.ConnectionEstablished += EIP_ConnectionEstablished;
            EIP.IPAddress = "192.168.129.2";
            EIP.EndInit();
           
            EIP.Read(tagName);

The weird thing is that I can read the same tag if I use the AdvancedHMI project by adding a comms driver and a control. After looking online for a few hours it appears Status Code 5 is usually the tag does not exist on the controller but I know this tag 100% exists. I'm out of ideas for debugging this issue, any help would be appreciated. Thanks!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Read Failed. Path Destination Unknown, Status Code=5
« Reply #1 on: October 12, 2017, 01:19:01 AM »
The status code 5 comes directly from the PLC, so it means a request is reaching the PLC and the PLC is responding. This can mean 1 of 3 things:

1) The tag doesn't exist
2) It is a program scope tag that is attempting to be read without the prefix designating the program
3) The PLC is set to restrict external access to the tag.

You can use Wireshark to see the request going to the PLC and it's response, but that won't really tell you any more than the error you see already.

When hitting a dead end with finding an error code 5 problem, my suggestion is always to run this code, then post the results from your Output Window:

Code: [Select]
Dim Tags() As MfgControl.AdvancedHMI.Drivers.CLXTag
Tags = EthernetIPforCLXCom1.GetTagList()
For i = 0 To Tags.Length
    Console.WriteLine(Tags(i).TagName)
Next

NicholasArbor

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Read Failed. Path Destination Unknown, Status Code=5
« Reply #2 on: October 12, 2017, 04:59:29 PM »
I get that it comes from the PLC, but I am able to read the same exact tag in the AdvancedHMI program. What is different between my code and the AdvancedHMI? Is there some configuration that I'm missing?

The getTagList always either times out or if I set the max timeout value to something really high it hangs and never completes.

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Read Failed. Path Destination Unknown, Status Code=5
« Reply #3 on: October 12, 2017, 05:14:50 PM »
1. try set a flag PLCIsConnected inside your connection established event.
2. If PLCIsConnected then do PLC.Readclock()  ' just to initiate some connection going.
3. then do the read.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

NicholasArbor

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Read Failed. Path Destination Unknown, Status Code=5
« Reply #4 on: October 12, 2017, 05:16:59 PM »
The PLC connection event never fires.

What would I be looking for in wireshark?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Read Failed. Path Destination Unknown, Status Code=5
« Reply #5 on: October 12, 2017, 05:20:33 PM »
I get that it comes from the PLC, but I am able to read the same exact tag in the AdvancedHMI program. What is different between my code and the AdvancedHMI? Is there some configuration that I'm missing?

The getTagList always either times out or if I set the max timeout value to something really high it hangs and never completes.
The GetTagList may seem to hang if you have a large number of tags, but in some cases it can take several minutes to complete.

There is no difference from your code to what the control use. They all get to a common method of BeginRead.

When running Wireshark, enter CIP in your filter. You will see the requests that passes the tag name to the PLC followed by the response. You can compare using the control versus using your code.

NicholasArbor

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Read Failed. Path Destination Unknown, Status Code=5
« Reply #6 on: October 12, 2017, 06:19:12 PM »
Thanks, i'll try out wireshark if I get a chance.

The getTagList has been running for just under an hour now and has not returned anything. There are a lot of tags but it shouldn't be taking this long.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Read Failed. Path Destination Unknown, Status Code=5
« Reply #7 on: October 12, 2017, 06:27:29 PM »
The getTagList has been running for just under an hour now and has not returned anything. There are a lot of tags but it shouldn't be taking this long.
That is definitely way too long. As a rough rule, estimate 10ms per 10 tags or 1000 tags per second.

Jeremy Buentello

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Read Failed. Path Destination Unknown, Status Code=5
« Reply #8 on: June 16, 2021, 05:57:49 PM »
I have received another error after trying to use the GetTagList() method

Error Id: -3
Error: Failed Tag Read, Status=5- edr(4)

I put in a large timeout and it never seems to return the list of tags. I can't seem to find out exactly what this error message means.