Author Topic: Read Failed. Check Processor Slot. Connection In Use or Duplicate forward Open  (Read 5258 times)

Fmoura

  • Newbie
  • *
  • Posts: 7
    • View Profile
Hello,

I'm developing a simple (Windows Service) Data Logger using AdvancedHMI Drivers and C#, and I'm taking the following error  'Object reference not set to an instance of an object'.

This error is given only when I use ControLogix PLC, but it's alright when I use MicroLogix.

I'm using:
  • .NET 4.0 Full
  • AdvancedHMI Drivers 3.98t
  • ONLY the AdvancedHMIDrivers.dll and MfgControl.AdvancedHMI.Drivers.dll

Edit:
Adding AdvancedHMIControls.dll as a reference I solved the error above, but I get those errors when running my project:
'Read Failed. Check Processor Slot. Connection In Use or Duplicate forward Open.,  Status Code=256'

Edit 2:
Communicating with OPC it's OK.

Have I tried:

Setted the packet size to 220. As seen here http://advancedhmi.com/forum/index.php?topic=868.msg4340#msg4340
Added references. As seen here http://advancedhmi.com/forum/index.php?topic=771.msg3713#msg3713
Added SubscriptionPollTimer. As seen here http://advancedhmi.com/forum/index.php?topic=505.msg2012#msg2012

And I continue with the same error.

Edit 3:
Analyzing with WireShark I got these errors: 0x01 and 0x15. In Common Industrial Protocol (CIP) documentation these errors are defined as:
  • Error 0x01 - Connection failure -  A connection related service failed along the connection path.
  • Error 0x15 - Too much data -  The service supplied more data than was expected
« Last Edit: July 24, 2015, 09:23:18 AM by Fmoura »

Fmoura

  • Newbie
  • *
  • Posts: 7
    • View Profile
These are what I got using WireShark (on attachment)


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
The ForwardOpen is showing connection in use. Do you see 2 ForwardOpens in the WireShark captures?

Fmoura

  • Newbie
  • *
  • Posts: 7
    • View Profile
Hi,
Thanks for reply.

To me it seems normal, it is opening and closing the connection.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
I think this is pointing to the ForwardClose. It is failing with too much data, therefore each ForwardOpen is opening a new port without the last being closed. What is is the ForwardClose packet?

Fmoura

  • Newbie
  • *
  • Posts: 7
    • View Profile
How can I see what is inside the packet? Looking at the bits?

I forgot to say, this error (Connection failure) not occurs often, but always shown "Too Much Data".

And I saved the WireShark capture at http://we.tl/ICMmvRy7UR. If you open it, add on filter: ip.addr==192.168.1.60

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Do you have any forward closes that are not giving this error?

This is the break down of the packet from your capture and I am seeing some extra bytes that don't seem to belong:

4e   Forward Close Service
02   Priority/Time Tick

20 06 24 01    ????????

07 9b Timeout Ticks

2c 00  Serial Number

41 52   Vendor ID
43 48 49 45    Serial Number

00 Reserved

03 01 00 20 02 24 01  Connection Path

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
This is the actual code that constructs that packet, so I can't figure out how those extra bytes are getting in the middle of it:

Code: [Select]
        b.Add(m_PriorityTimeTick)
        b.Add(m_TimeOutTicks)

        b.AddRange(BitConverter.GetBytes(m_ConnectionSerialNumber))

        b.AddRange(BitConverter.GetBytes(m_OriginatorVendorID))
        b.AddRange(BitConverter.GetBytes(m_OriginatorSerialNumber))

        '* Reserved byte
        b.Add(0)

        If m_ConnectionPath IsNot Nothing Then
            b.Add(m_ConnectionPath.Size)
            b.AddRange(m_ConnectionPath.GetBytes)
        Else
            '* No connection path, so give a size of 0
            b.Add(0)
        End If

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
I deciphered that packet incorrectly. This is the correct way it is broken down:

4e   Forward Close Service
02   Path size
20 06 24 01    Path to message router

07 Priority/Time Tick
9b Timeout Ticks

2c 00  Serial Number

41 52   Vendor ID
43 48 49 45    Serial Number

00 Reserved

03 01 00 20 02 24 01  Connection Path

Fmoura

  • Newbie
  • *
  • Posts: 7
    • View Profile
I don't know what else to do.
This error can be on my PLC? Or in my Ethernet Card? Because in all tested versions I dont could communicate directly with the ControlLogix without data loss, but with OPC its work very well. I have made a lot of changes in the code, but always a I get the same error.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
If you WireShark the OPC server, what is in the ForwardClose packet from it?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Are you explicitly closing the connection? If so, is it possible to just let the driver close the connection when it times out from no activity?

Fmoura

  • Newbie
  • *
  • Posts: 7
    • View Profile
Hi,

I have made a test reading three tags from PLC, then analyzing with WireShark I get three ForwardOpens and Closes. You can download this capute in http://we.tl/jjy3qLnXWd

On attachment is a ForwardClose bits using OPC.

And now I'm not closing the connection explicitly, but I already made tests using CloseConnection() and Dispose() and I had the same error.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Comparing AdvancedHMi and OPC, there are only 2 bytes different that mean anything. If you look at the last 8 bytes:

OPC
03 00 01 00 20 02 24 01

AdvancedHMI
00 03 01 00 20 02 24 01

Once I looked back at the CIP specification, I see the problem. The reserved byte (00) is supposed to be after the connection size (03 words).

Try the attached patch to see if it corrects the problem.
« Last Edit: July 30, 2015, 01:20:08 PM by Archie »

Fmoura

  • Newbie
  • *
  • Posts: 7
    • View Profile
ARCHIE

I don't know how can I to thank you, It is working perfectly!
Thank you very much for quckly reply and solve my problem.

haha I can't belive it's working with ControLogix.

I will do tests with a large amount of data and I will show here the results.