Author Topic: EthernetIPforCLXCom.vb ComErrorHandler Responded(e.TransactionNumber)  (Read 10406 times)

Randy

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: EthernetIPforCLXCom.vb ComErrorHandler Responded(e.TransactionNumber)
« Reply #15 on: August 22, 2013, 11:55:27 AM »
Ver. 3.57 has solved many problems.
I have found though that there are still some problems with Boolean arrays with an non zero index.
code that works for REAL won't work for BOOL.

Here is sample code:

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        Dim dTR0() As String = frmLoad.EthernetIPforCLXCom1.Read("HMI.REAL[0]", 1)
        Dim dTR1() As String = frmLoad.EthernetIPforCLXCom1.Read("HMI.REAL[1]", 1)
        Dim dT0() As String = frmLoad.EthernetIPforCLXCom1.Read("HMI.BOOL[0]", 1)
        Dim dT1() As String = frmLoad.EthernetIPforCLXCom1.Read("HMI.BOOL[1]", 1)
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        Dim k As Integer
        If Me.CheckBox1.Checked Then
            k = frmLoad.EthernetIPforCLXCom1.Write("HMI.BOOL[0]", 1)
            k = frmLoad.EthernetIPforCLXCom1.Write("HMI.BOOL[1]", 1)
            k = frmLoad.EthernetIPforCLXCom1.Write("HMI.REAL[0]", CSng(1))
            k = frmLoad.EthernetIPforCLXCom1.Write("HMI.REAL[1]", CSng(1))
        Else
            k = frmLoad.EthernetIPforCLXCom1.Write("HMI.BOOL[0]", 0)
            k = frmLoad.EthernetIPforCLXCom1.Write("HMI.BOOL[1]", 0)
            k = frmLoad.EthernetIPforCLXCom1.Write("HMI.REAL[0]", CSng(0))
            k = frmLoad.EthernetIPforCLXCom1.Write("HMI.REAL[1]", CSng(0))
        End If
    End Sub

Randy

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: EthernetIPforCLXCom.vb ComErrorHandler Responded(e.TransactionNumber)
« Reply #16 on: August 22, 2013, 12:44:39 PM »
I have also found that a read of a bool array is limited to 2080 bits.
in the PLC I have HMI.BOOL[2400]

 Dim dB() As String = fPLC.EthernetIPforCLXCom1.Read("HMI.BOOL[0]", 2330)

returns only 2080 elements in DB

Randy

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: EthernetIPforCLXCom.vb ComErrorHandler Responded(e.TransactionNumber)
« Reply #17 on: August 23, 2013, 05:56:34 PM »
I suggest the following changes in EthernetIPforCLXCom.CreateDLLInstance()

Change:

While DLL(i) IsNot Nothing AndAlso DLL(i).EIPEncap.IPAddress <> m_IPAddress AndAlso DLL(i).ProcessorSlot <> m_ProcessorSlot AndAlso i < 11
                i += 1
            End While

to

While DLL(i) IsNot Nothing AndAlso DLL(i).EIPEncap.IPAddress <> m_IPAddress AndAlso i < 11
                i += 1
            End While

Otherwise 2 PLC's with different IP addresses but both having the processor in slot 0 won't get a new instance.

Also  you added:

 DLL(MyDLLInstance).EIPEncap.IPAddress = m_Port

you probably meant:

 DLL(MyDLLInstance).EIPEncap.Port = m_Port


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: EthernetIPforCLXCom.vb ComErrorHandler Responded(e.TransactionNumber)
« Reply #18 on: August 23, 2013, 10:00:08 PM »
I suggest the following changes in EthernetIPforCLXCom.CreateDLLInstance()

Change:

While DLL(i) IsNot Nothing AndAlso DLL(i).EIPEncap.IPAddress <> m_IPAddress AndAlso DLL(i).ProcessorSlot <> m_ProcessorSlot AndAlso i < 11
                i += 1
            End While

to

While DLL(i) IsNot Nothing AndAlso DLL(i).EIPEncap.IPAddress <> m_IPAddress AndAlso i < 11
                i += 1
            End While

Otherwise 2 PLC's with different IP addresses but both having the processor in slot 0 won't get a new instance.
This will become a problem if there are 2 processors in the same rack. It should actually be like this:

Code: [Select]
While DLL(i) IsNot Nothing AndAlso (DLL(i).EIPEncap.IPAddress <> m_IPAddress OrElse DLL(i).ProcessorSlot <> m_ProcessorSlot) AndAlso i < 11

Randy

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: EthernetIPforCLXCom.vb ComErrorHandler Responded(e.TransactionNumber)
« Reply #19 on: September 03, 2013, 07:55:21 PM »
Here are some problems I found in Ver. 3.58  EthernetIPforCLXCom

A SINT does not come back as signed.  A negative number in the PLC shows up as a positive number > 128 after a read.
(INT,DINT, & LINT work OK)

A read of a BOOL array is limited to 2080 elements.  To replicate,create a BOOL array in the PLC with 4000 elements.

Try to read them all and the returned string array is only 2080 elements.