That's probably why. My PLC is a 5370.
Such messy string definition , for ex. STRING_8 can contains up to 24 chars.
I was able to import it into a L330ERMS2, rework the UDT to v2. then import to my PLC.
It took less than a second to read all tags.
see picture & attached v2.
Yes, I can read the UDT structure with the tag reader. I'm trying now to read the data with ReadUDT.
Here is what I have as the structure.
Module HMI_UDT_Class
Public completeData As UDT_HMI_StationStatus
Public Class STR0004
Public len1 As Int32
Public STR4(4) As SByte
End Class
Public Class STR0016
Public len2 As Int32
Public STR16(16) As SByte
End Class
Public Class STR0024
Public len3 As Int32
Public STR0024(24) As SByte
End Class
Public Class String_24
Public len4 As Int32
Public Str24(24) As SByte
End Class
Public Class String_8
Public len5 As Int32
Public Str_8(24) As SByte
End Class
Public Class UDT_HMI_ActivePartProgram
Public Program(19) As String
Public SubProgram(9) As String
Public ProgramName As String
Public SubProgramName As String
Public ProgramNumber As Int32
Public SubProgramNumber As Int32
Public ProgramLineNumber(19) As Int32
Public SubProgramLineNumber(9) As Int32
Public SubActive As Boolean
End Class
Public Class UDT_HMI_AngleOffset
Public angleOffsetReq As Boolean
Public angleOffsetVal As Single
End Class
Public Class UDT_HMI_Axis
Public Enabled As Boolean
Public InPos As Boolean
Public Homed As Boolean
Public Returned As Boolean
Public Faulted As Boolean
Public CmdPos As Single
Public AbsPos As Single
Public Speed As Single
Public SpeedUnits As String
Public Present As Boolean
Public InhibitStatusButs As Int32
Public CurrentFaultCode As Int32
Public jogPos As Boolean
Public jogNeg As Boolean
Public jogEnabled As Boolean
Public Name As STR0004
Public MtrCurr As Single
Public MtrCap As Single
Public InvCap As Single
Public PosErr As Single
End Class
Public Class UDT_HMI_AxisJog
Public pos As Boolean
Public neg As Boolean
Public enabled As Boolean
Public incChange As Boolean
Public speed(5) As Single
Public unit As String_8
Public incSel As SByte
Public spdSel As SByte
Public increment(4) As Single
Public mode As Boolean
Public axisSelect As SByte
Public axisPresent(32) As Boolean
Public axisType As Int16
Public axisName(6) As STR0004
End Class
Public Class UDT_HMI_Button
Public Target As Boolean
Public Active As Boolean
End Class
Public Class UDT_HMI_Coordinates
Public X(500) As Single
Public Y(500) As Single
Public Angle(500) As Single
Public Dist(500) As Single
Public Active(500) As SByte
End Class
Public Class UDT_HMI_FeedrateOverride
Public spdUnits As String_8
Public Feedrate As Single
Public overrideFeedrate As Single
Public overrideEnabled As Boolean
Public feedratePct As Single
Public RapidPct As Int32
End Class
Public Class UDT_HMI_MachineStatus
Public gStop As STR0016
Public mStop As STR0016
Public activeMcode(7) As STR0024
Public activeGcode(7) As STR0024
Public registers(15) As STR0024
Public gBlink As Boolean
Public mBlink As Boolean
End Class
Public Class UDT_HMI_Parameters
Public Number(5) As Int32
Public Value(5) As Single
Public Name(5) As String_24
End Class
Public Class UDT_HMI_Spindle
Public AtSpeed As Boolean
Public Enabled As Boolean
Public Faulted As Boolean
Public CmdSpeed As Single
Public ActSpeed As Single
Public SpeedUnits As String
Public Present As Boolean
Public Direction As Boolean ' 0=CW 1= CCW
Public Name As STR0004
Public MotorCap As Single
End Class
Public Class UDT_HMI_StateModle
Public State As SByte
Public notComplete As Boolean
Public notCpEM As SByte
End Class
Public Class UDT_HMI_toolPathGraph
Public inchMode As Boolean
Public metricMode As Boolean
Public SampleActive As Boolean
Public Coordinates As UDT_HMI_Coordinates
Public GraphClear As UDT_HMI_Button
Public SampleRate As Single
Public PosX As Single
Public PosY As Single
Public PosZ As Single
Public UserPosX As Single
Public UserPosY As Single
Public UserPosZ As Single
Public UserMaxX As Single
Public UserMinX As Single
Public UserMaxY As Single
Public UserMinY As Single
Public UserMaxZ As Single
Public UserMinZ As Single
Public DistThreshold As Single
Public Units As String
Public zoomPct As Single
End Class
Public Class UDT_HMI_StationStatus
Public btnAuto As UDT_HMI_Button
Public btnContinous As UDT_HMI_Button
Public btnSingleStep As UDT_HMI_Button
Public btnCycleStart As UDT_HMI_Button
Public btnCycleStop As UDT_HMI_Button
Public btnCycleAbort As UDT_HMI_Button
Public btnTestMode As UDT_HMI_Button
Public btnMode As UDT_HMI_Button
Public btnManual As UDT_HMI_Button
Public btnoptionalStop As UDT_HMI_Button
Public btnBlockDelete As UDT_HMI_Button
Public btnEmergencyReturn As UDT_HMI_Button
Public btnControlReset As UDT_HMI_Button
Public btnFaultReset As UDT_HMI_Button
Public Axis01 As UDT_HMI_Axis
Public Axis02 As UDT_HMI_Axis
Public Axis03 As UDT_HMI_Axis
Public Axis04 As UDT_HMI_Axis
Public Axis05 As UDT_HMI_Axis
Public Axis06 As UDT_HMI_Axis
Public Axis07 As UDT_HMI_Axis
Public Spindle01 As UDT_HMI_Spindle
Public Spindle02 As UDT_HMI_Spindle
Public Spindle03 As UDT_HMI_Spindle
Public Spindle04 As UDT_HMI_Spindle
Public Spindle05 As UDT_HMI_Spindle
Public ActivePartProgram As UDT_HMI_ActivePartProgram
Public AxisFault As Boolean
Public State As Int32
Public Mode As Int32
Public ToolPathGraph As UDT_HMI_toolPathGraph
Public MachineStatus As UDT_HMI_MachineStatus
Public FeedRateOverride As UDT_HMI_FeedrateOverride
Public stopIndicate As Boolean
Public AxisJog As UDT_HMI_AxisJog
Public Parameters As UDT_HMI_Spindle
Public StateModel As UDT_HMI_StateModle
Public AngleOffset As UDT_HMI_AngleOffset
End Class
End Module
Read
completeData = EthernetIPforCLXCom1.ReadUDT(Of HMI_UDT_Class.UDT_HMI_StationStatus)("Test_UDT")
I get this fault
IndexOutOfRangeException: Index was outside the bounds of the array.