AdvancedHMI Software
General Category => Support Questions => Topic started by: baliam 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?
-
Can you take a screenshot of your UDT expanded in the controller tags as well as a screenshot of the line of code you are using to read the tag? What data types are these?
-
I can't seem to upload any screenshots, as they keep clearing.
Visual Studio code
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)
-
You have to write the code to read each specific tag:
plcResults = _syncReadPLC.ReadAny("RecipeStore[0].OD")
'add to your list
plcResults = _syncReadPLC.ReadAny("RecipeStore[0].Number")
'add to your list
'and so on