Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mondacag

Pages: [1]
1
Windows 7 Professional, upgraded from 3.99w to 3.99x and set the timeout to 5000 instead of the default 4000.
Haven't checked if there have been any system updates (OS, .NET Frameworks, etc) since our customer's IT department is the responsible for that.

2
Thanks for your responce Archie.

It's almost two weeks since we implemented your recomendations, we haven't received any complains about this issue.
I fortgot to mention that due to our customer requeriments we are using VS2010.

3
Our customer is experiencing some issues with the application we devoloped. For the nature of the error messages i suspect is some kind of interweaving.

We are using v3.99w

There is only one drive to communicate with a compactlogix, the PollRateOverride was set to 500, just changed to 2000 as recomended in another thread (https://advancedhmi.com/forum/index.php?topic=1763.0)

The error shows sometimes when trying to read an UDT of 1244 bytes. Some times it shows the "No Response From PLC" message, and other times it shows an error message "index and length must refer to a location in the string", i think it is related with the code to extract the data from the UDT.

While connected over teamviewer i saw the message "read failed. unknown code 38, status code=38", but i wasn't able to reproduce.

There are 9 BasicLabels being used with the ValueChanged event to do different actions like read and write individual tags from/to the PLC.

This used to happen once in a while, the customer used to solve this by restarting the application, but it started to happen too often since yesterday. They noticed the machine time cycle increased. And while monitoring, i noticed that some times it takes too much time to execute one of the events. Maybe because the program is doing something else.

I'm considering to add a second driver for readyng the data only.

Any suggestion are welcome

4
Support Questions / Re: Reading a large amount of tags
« on: June 28, 2017, 11:31:58 PM »
I know what you mean Archie. It is similar to what happens when trying to read a custom string, you get the raw data the four bytes of the lenght followed for the data bytes of the string.

I have an idea of how to do the parsing. I got some help to develop the app using another driver for the communication. The AOI i mentioned in a previous post is to concatenate al the data in string format using a token between values, to then split everything in the VB app. That's why i have that increase in the PLC scan time, also i got an string with 1600 chars. I'm looking for a better way to do this.

I remember trying to read the whole UDT whe i started testing with AHMI, but did't received a response. I'm gonna give it another try.

Edit: After a couple of hours testing (most of it arranging the variables to parse the data), i'm able to read the whole UDT and parse it to a variable with the same structure. The routine to parse the data has about 310 lines of code, but it only takes from 20 to 30ms to read all the data. The only thing left is test it on site.

5
Support Questions / Re: Reading a large amount of tags
« on: June 28, 2017, 06:22:25 PM »
There is some hope

It's actually a coincidence this topic came back up because just this past week the driver had been given functionality to write complete UDTs and custom length strings. If testing goes well this coming week, it should be part of the next release.

6
Support Questions / Re: Reading a large amount of tags
« on: June 28, 2017, 03:27:39 PM »
I have an array of structured UDT used to store production data and limits. There are 272 elements or tags (more could be added) that needs to be logged. I tried with consecutive individual reads using:
Code: [Select]
NumNido = EIPforCLX1.Read("Num_Nido_E12")
Data.NestNum.Valor = EIPforCLX1.Read("Nido[" & NumNido & "].NestNum.Valor")
Data.NestNum.C_Error = EIPforCLX1.Read("Nido[" & NumNido & "].NestNum.Codigo_Falla")

I tested it with a CLX L18ER and a HP ZBook G3 15 with a Core i7. The PLC has no code, only the tags. It takes 1.5 seconds to read all the data after the fist read. But when i tested it on site in a L36ERM with 12 programs, 23 Ethernet IP devices (robocilinders, 2d scanners, vision sensors, an SCARA, communication units, and some RS232 devices), 5 HMI, and an industrial PC to log the data (iTac)

First the PLC was running two tasks, one periodic (20ms) and one continuos(20ms min 150ms max due an AOI and the periodic task). It took almost 3 minutes to read the data that was downloaded 2.5 minutes ago.

Then i disabled the periodic task, leaving only the continuos (now 20ms min 100ms max due the AOI), and it took somewhat 16 seconds to read all the data, plus the station time cycle (pick&place) plus the time to send the data to the server (less than 2 seconds), it almost 30 seconds. And the machine is planned to produce a piece every 15 seconds.

The machine has a dial with 12 positions, and all the operations are distributed in 11 stations.

Now i was trying to use the BeginReadMultiple method, similar as described by Archie, with some extra code to ensure the data was read before changing the Tag list:

I have a routine to asign all the tag names depending on the nest presente in station 12
Code: [Select]
        NumNido = EIPforCLX1.Read("Num_Nido_E12") 'Read the Nest Number in Station 12: Download
        PLCAddress(0) = "Nido[" & NumNido & "].NestNum.Valor"
        PLCAddress(1) = "Nido[0].NestNum.Lim_Inf"  'The element or nest 0, stores the limits for the machine
        PLCAddress(2) = "Nido[0].NestNum.Lim_Sup"
        PLCAddress(3) = "Nido[" & NumNido & "].NestNum.Codigo_Falla"

To implement the MultiRead:
Code: [Select]
            'Clear all the read status
            For i = 0 To 271
                Read(i) = False
            Next
            'Dimention the array depending on the number of tags that can be read
            ReDim TagList(12)
            For i = 0 To 12
                TagList(i) = PLCAddress(i) 'Asign the PLCAddress to the Tag list
            Next
            EIPforCLX1.BeginReadMultiple(TagList)
            Do Until DataRead = 13 'Checks if all the tags in the list were read
                DataRead = 0
                Application.DoEvents()
                For i = 0 To 12
                    If Read(i) Then
                        DataRead += 1
                    End If
                Next
            Loop
            Redim TagList(11) 'Repeat the code to read all the tags



Then to receive the data, i didn't wanted to write an IF..THEN for every element:
Code: [Select]
    Private Sub EIPforCLX1_DataReceived(ByVal sender As Object, ByVal e As Drivers.Common.PlcComEventArgs) Handles EIPforCLX1.DataReceived
        If e.ErrorId = 0 Then
            'If e.PlcAddress = TagList(0) Then
            '    Data_Value(0) = e.Values(0)
            'End If

            For i = 0 To 271

                If e.PlcAddress = PLCAddress(i) Then
                    For j = 0 To TagList.Length
                        If e.PlcAddress = TagList(j) Then
                            Data_Value(i) = e.Values(0)
                            Read(i) = True
                            'Exit For
                        End If
                    Next
                End If
                If Read(i) Then
                    'Exit For
                End If
            Next

        End If
    End Sub

When i tested this in the PLC i have in the office (L18ER), i took almos 4 seconds to read the data. I have to test it on site to see if there is some improvement in the time.

7
Support Questions / Re: Not Enough Data
« on: June 12, 2017, 02:57:29 PM »
Those are excellent news. I just started using AdvancedHMI to improve an application we made with an older version of ASABTCP.

We need to read an UDT with +270 elements. For now we are going to work with the current release.

We will be looking forward for the next release.

After been working a while and usig the ExtractString function, it returns the content of the data array as string, so we added some lines to check the length, and only assign to the variable the number of characters the tag says it have.
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 = ""
        If StringLength > 0 Then
            StringResult = System.Text.Encoding.Default.GetString(bytes, 4, bytes.Length - 4)
            StringResult = Mid(StringResult, 1, StringLength)
        End If
        Return StringResult
    End Function

8
Support Questions / Re: Not Enough Data
« on: June 11, 2017, 07:49:01 PM »
The problem there is that when using custom strings, those are seen as UDTs and when the drivers read them it reads some extra data, so when you try to write the data back it show the error of "Not Enough Data".

It is recommended to keep track of the size of the custom strings being used. So as suggested as Archie

To write to this string, you can do something like this:

'* Write ABC to a custom string
Dim ByteValues() as string={"65",66","67"}
ClxDriver1.BeginWrite("MyString.LEN",ByteValues.length}
clxDriver1.BegineWrite("MyString.Data",ByteValues)

I have done it this way:

Code: [Select]
                Dim MyString As String = "My Data"
                Dim lLen As Integer = 0
                'Checks if the string length exceeds the custom string length
                If MyString.Length > lLen Then
                    'Sets the maximum length. It will trunc the string we are trying to write to the tag
                    lLen = 13
                Else
                    lLen = MyString.Length
                End If
                For i = 0 To lLen - 1
                    EthernetIPforCLXCom1.Write("MyString.Data[" & i & "]", Mid(MyString, i + 1, 1))
                Next
                EthernetIPforCLXCom1.Write("MyString.Len", MyString.Length)

I prefer to write the byte array first and then the lenght

Pages: [1]