Author Topic: CLX EIP Driver No Response From PLC  (Read 2037 times)

seth350

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
CLX EIP Driver No Response From PLC
« on: May 09, 2017, 09:55:12 AM »
Trying to read an array of 27 strings that are all standard length. It seems the driver gets hung up on reading anything over 20, so I divided the reads. Sometimes this works and sometimes it doesn't.

I also tried creating another driver to handle one half, and that gave the same results.

Driver is set to 1000 poll rate with 8000 timeout.

Any ideas?

Code: [Select]
Public Class MainForm
    '*******************************************************************************
    '* Stop polling when the form is not visible in order to reduce communications
    '* Copy this section of code to every new form created
    '*******************************************************************************
    Private NotFirstShow As Boolean

    Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
        '* Do not start comms on first show in case it was set to disable in design mode
        If NotFirstShow Then
            AdvancedHMIDrivers.Utilities.StopComsOnHidden(components, Me)
        Else
            NotFirstShow = True
        End If
    End Sub

    '***************************************************************
    '* .NET does not close hidden forms, so do it here
    '* to make sure forms are disposed and drivers close
    '***************************************************************
    Private Sub MainForm_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        Dim index As Integer
        While index < My.Application.OpenForms.Count
            If My.Application.OpenForms(index) IsNot Me Then
                My.Application.OpenForms(index).Close()
            End If
            index += 1
        End While
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim stuff() As String
        Dim junk() As String
        Dim ack As Boolean
        Dim upc As String


        stuff = conPLC1.Read("PROGRAM:MainProgram.Station1.SQL.Receive.Component[0]", 13)
        junk = conPLC1.Read("PROGRAM:MainProgram.Station1.SQL.Receive.Component[13]", 14)

        complist.Items.Clear()
        complist.Items.AddRange(stuff)
        complist.Items.AddRange(junk)


        conPLC1.Write("PROGRAM:MainProgram.Station1.resultNewArrivalACK", 1)
        ack = conPLC1.Read("PROGRAM:MainProgram.Station1.resultNewArrivalACK")

        If ack = True Then

            conPLC1.Write("PROGRAM:MainProgram.Station1.resultNewArrivalACK", 0)

        End If



        upc = upclabel.Text.ToString

        If upc.Contains("08856") Then

            If upc.Length = 13 Then

                checklabel.Text = "Scanned Code Is A UPC Number. Transferred To FTTM."

            Else

                checklabel.Text = "Scanned Code Is Not A UPC Number. Copied To Compare Array In PLC."

            End If

        End If
    End Sub
End Class

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: CLX EIP Driver No Response From PLC
« Reply #1 on: May 09, 2017, 10:01:22 AM »
Are you using the latest version of 3.99w ?

Phrog30

  • Guest
Re: CLX EIP Driver No Response From PLC
« Reply #2 on: May 09, 2017, 11:47:57 AM »
When it doesn't work what happens, an error, nothing, etc.?  I suggest using a datasubscriber to read your array, in my opinion that is more efficient.

seth350

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: CLX EIP Driver No Response From PLC
« Reply #3 on: May 09, 2017, 06:29:49 PM »
Yes, latest version.



I did have a datasubscriber assigned to a boolean tag in the plc that would trigger the code you see. I added the button recently just for testing.

The prior method using the DS would throw an exception "No Response From PLC" on this line:
Code: [Select]
stuff = conPLC1.Read("PROGRAM:MainProgram.Station1.SQL.Receive.Component[0]", 13)
This would occur about four seconds after the application started.

But, you may be suggesting to use the Datasubscriber to physically read the array. I suppose the datasubscriber has a class object that would then hold that array to allow me to do something with it?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: CLX EIP Driver No Response From PLC
« Reply #4 on: May 09, 2017, 07:09:00 PM »
Are you running RSLogix on the same PC? I'm wondering if there are too many requests going to the PLC and it ignores some. A definite way to figure out the problem is to run a Wireshark capture and post it. From that I would be able tell if the request went out and if the PLC responded.

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: CLX EIP Driver No Response From PLC
« Reply #5 on: May 09, 2017, 10:20:21 PM »
If you are using Data Subscriber, you should use async read in your data change event and check receiving data in received data event.
Also make sure to check number Enet connections not maxed out.
Try copy/ change to controller tag, shorter is better.

Can you post a screenshot of your PLC UDT tag in monitor mode.   
« Last Edit: May 09, 2017, 10:58:50 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

seth350

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: CLX EIP Driver No Response From PLC
« Reply #6 on: May 10, 2017, 09:44:45 AM »
Are you running RSLogix on the same PC? I'm wondering if there are too many requests going to the PLC and it ignores some. A definite way to figure out the problem is to run a Wireshark capture and post it. From that I would be able tell if the request went out and if the PLC responded.

I am on my development pc, but I also transferred the application to the runtime pc (which is too running RsLinx and Factorytalk Transaction Manager) and it did not work. It gave the same exception.

Looking at wireshark, there is a constant polling between my development pc and the plc when the application is running.
The wireshark log that I am attaching starts out without the application running. I then start the application, and then click my Button to read the array. It then throws the No Response From PLC Exception.

UDT image is also included.

Phrog30

  • Guest
Re: CLX EIP Driver No Response From PLC
« Reply #7 on: May 10, 2017, 09:55:30 AM »
FYI, to read strings that aren't a native length of 82 you will need to run the data through this code for the data to display properly.  At least, I wasn't able to get it to work without the code:

Code: [Select]
Private Function ExtractString(ByVal s As String) As String
        Dim bytes((s.Length / 2) - 1) As Byte
        For i = 0 To (s.Length / 2) - 1
            bytes(i) = Byte.Parse(s.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber)
        Next
        Dim StringLength As Integer = BitConverter.ToInt32(bytes, 0)
        Dim StringResult As String = System.Text.Encoding.Default.GetString(bytes, 4, bytes.Length - 4)

        Return StringResult
    End Function

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: CLX EIP Driver No Response From PLC
« Reply #8 on: May 10, 2017, 11:06:20 AM »
I can see at packet 274, it initiates the read, then begins receiving it in partial packets. Before it is finished, the subscriptions slip in an update at packet 284, but it picks back up at 286 to continue reading the partial packets and completes at packet 289.

So this makes me wonder if the subscription packet sneaking in a request is causing the problem. There are 2 different things to try to help me figure out if  this is the problem. First set the PollRateOverride to something very slow like 2000. See if the array of strings read successfully more frequently. The other thing to try is to make a copy of your driver instance, then use that copy only for reading the strings.

seth350

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: CLX EIP Driver No Response From PLC
« Reply #9 on: May 10, 2017, 03:15:22 PM »
I ran the app at 4000ms pollrateoveride and did not get an exception and the data came through as it should have.
Ran it at 2000ms and same result.
Ran it once more at my original 1000ms and same result.

It is working now, but what gives?

I am including two dumps for the 2000ms attempt and the 4000ms attempt. I forgot to save the 1000ms capture.  :-[
 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: CLX EIP Driver No Response From PLC
« Reply #10 on: May 10, 2017, 03:30:56 PM »
I suspect it is the interweaving of the subscription requests with the partial transfers, but will not be able to confirm it for a few days. You can do a further test by setting the PollRateOverride to 0, then see if the problem ocurs. If it does, then use multiple reads of only 3 strings per read which will eliminate the partial transfers by keeping the packet size below 510.