Author Topic: EthernetIPforCLX WriteUDT Intermittent Failure  (Read 697 times)

ApexAutomation

  • Newbie
  • *
  • Posts: 5
    • View Profile
EthernetIPforCLX WriteUDT Intermittent Failure
« on: February 27, 2019, 11:06:42 AM »
Experiencing intermittent failures with different error returns using the WriteUDT method. Fails between 30 - 50% of the time on WriteUDT method using the same parameter data. ReadUDT runs flawlessly using the same data type. Any help would be greatly appreciated.

    public class UDT_Camera_Positions
    {
        public float[] Positions;
        public int Number_Of_Stops;
        public float[] Zone_Min_Value;
        public float[] Zone_Max_Value;
        public string[] Zone_Names;

 
ClxDriver
    Version: 1.2.3.0
    Runtime Version: 4.0.30319



Application Testing
       
    ex.Message
              Message   "Source array was not long enough. Check srcIndex and length, and the array's lower bounds."   string

    ex.Stacktrace
              StackTrace   "   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)\r\n   
                at System.Collections.Generic.List`1.ToArray()\r\n   at j.f()\r\n   at ClxDriver.CIP.MessageRouterRequest.GetBytes()\r\n   
                at ClxDriver.CIP.CommonIndustrialProtocol.a(MessageRouterRequest A_0)\r\n   
                at ClxDriver.CIP.CommonIndustrialProtocol.ConnectedSend(MessageRouterRequest MRR, Int32 sequenceNumber, Int64 ownerObjectID)\r\n   
                at ClxDriver.CIP.CommonIndustrialProtocol.ConnectedSend(Int32 serviceCode, IEPath path, Byte[] data, Int32 sequenceNumber, Int64 ownerObjectID)\r\n   
                at ClxDriver.CIP.CIPforCLX.a(CLXAddress A_0, UInt16 A_1, Byte[] A_2, Int32 A_3, Int64 A_4)\r\n   
                at ClxDriver.EthernetIPforCLX.BeginWriteRaw(String startAddress, Int32 numberOfElements, Byte[] dataToWrite)\r\n   
                at ClxDriver.EthernetIPforCLX.WriteRaw(String startAddress, Int32 numberOfElements, Byte[] dataToWrite)\r\n   
                at ClxDriver.EthernetIPforCLX.WriteUDT(String udtName, Object structureDataToWrite)\r\n   
                at PLC_Clx.Comms.WriteUDT[T](String Tagname, T UDT_Object) in C:\\Users\\apexa\\...


    ex.Message
              Message   "Index was outside the bounds of the array."   string

    ex.StackTrace
              StackTrace   "   at System.Array.Clear(Array array, Int32 index, Int32 length)\r\n   at System.Collections.Generic.List`1.Clear()\r\n   at j.c()\r\n   at j.f()\r\n   
                at ClxDriver.CIP.MessageRouterRequest.GetBytes()\r\n   at ClxDriver.CIP.CommonIndustrialProtocol.a(MessageRouterRequest A_0)\r\n   
                at ClxDriver.CIP.CommonIndustrialProtocol.ConnectedSend(MessageRouterRequest MRR, Int32 sequenceNumber, Int64 ownerObjectID)\r\n   
                at ClxDriver.CIP.CommonIndustrialProtocol.ConnectedSend(Int32 serviceCode, IEPath path, Byte[] data, Int32 sequenceNumber, Int64 ownerObjectID)\r\n   
                at ClxDriver.CIP.CIPforCLX.a(CLXAddress A_0, UInt16 A_1, Byte[] A_2, Int32 A_3, Int64 A_4)\r\n   
                at ClxDriver.EthernetIPforCLX.BeginWriteRaw(String startAddress, Int32 numberOfElements, Byte[] dataToWrite)\r\n   
                at ClxDriver.EthernetIPforCLX.WriteRaw(String startAddress, Int32 numberOfElements, Byte[] dataToWrite)\r\n   
                at ClxDriver.EthernetIPforCLX.WriteUDT(String udtName, Object structureDataToWrite)\r\n   
                at PLC_Clx.Comms.WriteUDT[T](String Tagname, T UDT_Object) in C:\\Users\\apexa\\...

    ex.Message 
          Message   "Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"   string

    ex.StackTrace
          StackTrace   "   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)\r\n   
            at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)\r\n   at j.c()\r\n   at j.f()\r\n   at ClxDriver.CIP.MessageRouterRequest.GetBytes()\r\n   
            at ClxDriver.CIP.CommonIndustrialProtocol.a(MessageRouterRequest A_0)\r\n   at ClxDriver.CIP.CommonIndustrialProtocol.ConnectedSend(MessageRouterRequest MRR, Int32 sequenceNumber, Int64 ownerObjectID)\r\n   
            at ClxDriver.CIP.CommonIndustrialProtocol.ConnectedSend(Int32 serviceCode, IEPath path, Byte[] data, Int32 sequenceNumber, Int64 ownerObjectID)\r\n   
            at ClxDriver.CIP.CIPforCLX.a(CLXAddress A_0, UInt16 A_1, Byte[] A_2, Int32 A_3, Int64 A_4)\r\n   at ClxDriver.EthernetIPforCLX.BeginWriteRaw(String startAddress, Int32 numberOfElements, Byte[] dataToWrite)\r\n   
            at ClxDriver.EthernetIPforCLX.WriteRaw(String startAddress, Int32 numberOfElements, Byte[] dataToWrite)\r\n   at ClxDriver.EthernetIPforCLX.WriteUDT(String udtName, Object structureDataToWrite)\r\n   
            at PLC_Clx.Comms.WriteUDT[T](String Tagname, T UDT_Object) in C:\\Users\\apexa\\...

       


Unit Testing

    Message: System.InvalidCastException : Unable to cast object of type 'System.Object' to type 'PLC_Clx.Tests.UDT_Camera_Positions'.

    Message: ClxDriver.Common.PLCDriverException : Path Segment Error (Invalid Tag Name)


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5270
    • View Profile
    • AdvancedHMI
Re: EthernetIPforCLX WriteUDT Intermittent Failure
« Reply #1 on: February 27, 2019, 11:15:56 AM »
Can you post your UDT definition and I will try to replicate this.

ApexAutomation

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: EthernetIPforCLX WriteUDT Intermittent Failure
« Reply #2 on: February 27, 2019, 11:40:09 AM »
    public class UDT_Camera_Positions
    {
        public float[] Positions;
        public int Number_Of_Stops;
        public float[] Zone_Min_Value;
        public float[] Zone_Max_Value;
        public string[] Zone_Names;

        public UDT_Camera_Positions()
        {
            Positions = new float[100];
            Number_Of_Stops = 0;
            Zone_Min_Value = new float[10];
            Zone_Max_Value = new float[10];
            Zone_Names = new string[10];
        }

    }

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5270
    • View Profile
    • AdvancedHMI
Re: EthernetIPforCLX WriteUDT Intermittent Failure
« Reply #3 on: February 27, 2019, 11:45:09 AM »
I was actually looking for the UDT definition. Are your strings standard length? Are the integers DINTs? I can assume the floats are REALs.

ApexAutomation

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: EthernetIPforCLX WriteUDT Intermittent Failure
« Reply #4 on: February 27, 2019, 12:06:26 PM »
Sorry, misunderstood.

Positions REAL[100]
Number_Of_Stops DINT
Zone_Min_Value   REAL[10]
Zone_Max_Value REAL[10]
Zone_Names STRING[10]

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5270
    • View Profile
    • AdvancedHMI
Re: EthernetIPforCLX WriteUDT Intermittent Failure
« Reply #5 on: February 27, 2019, 03:31:21 PM »
I was able to replicate this and I think I found the root cause. I'll see about getting you an updated version by end of day tomorrow.

ApexAutomation

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: EthernetIPforCLX WriteUDT Intermittent Failure
« Reply #6 on: February 27, 2019, 03:39:43 PM »
Thank you, Sir.

ApexAutomation

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: EthernetIPforCLX WriteUDT Intermittent Failure
« Reply #7 on: February 27, 2019, 05:28:33 PM »
Your updated driver passed unit test for 100 iterations....

Outstanding response time from you!

I'll run some more testing, but I believe you can close the ticket on this one.