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 - baliam

Pages: [1]
1
Support Questions / Re: Read from an array
« on: July 15, 2013, 02:39:18 PM »
I can't seem to upload any screenshots, as they keep clearing.

Visual Studio code
Code: [Select]
    Private Sub LoadRecipes(ByVal RecipesLoaded As Int32)

        Try

            For i As Int32 = RecipesLoaded To 50
                Dim plcResults As String()
                'plcResults = _syncReadPLC.ReadSynchronous("RecipeStore", 1)
                plcResults = _syncReadPLC.ReadAny("RecipeStore", 1, False)
                uxRecipeList.Items.Add(i & " - " & plcResults(0) & """ Diameter Pipe")
                RecipesLoaded += 1
            Next

            uxRecipeList.SelectedIndex = 0

        Catch ex As Exception

            Trace.WriteLine(RecipesLoaded)
            If ex.ToString().Contains("Read Failed - Status Code=-20") Then
                LoadRecipes(RecipesLoaded)
            Else
                Console.WriteLine(ex.ToString())
            End If

        End Try

    End Sub

PLC Data types
RecipeStore[0]    (RecipeStorage datatype)
     RecipeStore[0].Number    (DINT datatype)
     RecipeStore[0].OD    (Real datatype)
     RecipeStore[0].Description    (String datatype)
     RecipeStore[0].PT    (Recipe_Single datatype)
          RecipeStore[0].PT.Entry    (Real[10] datatype)
               RecipeStore[0].PT.Entry[0] - [10]    (Real datatype)

2
Support Questions / Read from an array
« on: July 15, 2013, 02:08:19 PM »
I am using v3.40 of AdvancedHMI.

I have an array data structure with an array nested inside it like below:
RecipeStore[0]
     RecipeStore[0].Number
     RecipeStore[0].OD
     RecipeStore[0].Description
     RecipeStore[0].PT
          RecipeStore[0].PT.Entry
               RecipeStore[0].PT.Entry[0] - [10]
RecipeStore[1]
     RecipeStore[1].Number
     RecipeStore[1].OD
     RecipeStore[1].Description
     RecipeStore[1].PT
          RecipeStore[1].PT.Entry
               RecipeStore[1].PT.Entry[0] - [10]
and repeats to 51.

Whenever I attempt to read RecipeStore[1].OD (or anything from RecipeStore), I get the following error in VS2010.
System.OverflowException: Arithmetic operation resulted in an overflow.
   at MfgControl.AdvancedHMI.Drivers.CIP.GetTagIndex(CLXAddress TagName)
   at MfgControl.AdvancedHMI.Drivers.CIP.ReadTagValue(CLXAddress clxTag, UInt16 numberOfElements, UInt16 sequenceNumber)
   at AdvancedHMIDrivers.EthernetIPforCLXComm.ReadAny(String startAddress, Int32 numberOfElements, Boolean AsyncModeIn) in D:\Source\AdvancedHMI v340\AdvancedHMIDrivers\EthernetIPforCLXComm.vb:line 338
   at MfgControl.AdvancedHMI.RecipeForm.LoadRecipes(Int32 RecipesLoaded) in D:\Source\AdvancedHMI v340\AdvancedHMI\RecipeForm.vb:line 177

Does anyone have any thoughts or input?

Pages: [1]