1
Support Questions / Re: AdvancedHMI not correct .NET framework for nugget.
« on: May 10, 2024, 09:07:48 AM »
See if it will help: https://www.advancedhmi.com/forum/index.php?topic=2209.msg12744#msg12744
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.
1. ImageDisplayByValue property set Autosize to False.
2. You can change size of image in the property of ImageList.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
EthernetIPforCLXCom1.IPAddress = TextBox1.Text
EthernetIPforCLXCom1.ProcessorSlot = TextBox2.Text
'* Retreive the tags from the PLC
Dim AllTags() As AdvancedHMI.Drivers.CLXTag = EthernetIPforCLXCom1.GetTagList
'* Clear anything in the TreeView
TreeView1.Nodes.Clear()
'* Add all tags to the tree view
For i = 0 To AllTags.Length - 1
Dim Node As New TreeNode(AllTags(i).TagName)
If AllTags(i).ArrayElements1 > 0 And AllTags(i).ArrayElements2 <= 0 Then
Node.Text &= " [" & AllTags(i).ArrayElements1 & "]"
ElseIf AllTags(i).ArrayElements2 > 0 And AllTags(i).ArrayElements2 <= 0 Then
Node.Text &= " [" & AllTags(i).ArrayElements1 & "," & AllTags(i).ArrayElements1 & "]"
ElseIf AllTags(i).ArrayElements3 > 0 Then
Node.Text &= " [" & AllTags(i).ArrayElements1 & "," & AllTags(i).ArrayElements1 & "," & AllTags(i).ArrayElements3 & "]"
End If
'* If the Tag is a UDT, then add the structure name in parentheses
If (AllTags(i).IsStructure) Then
Node.Text &= " (" & AllTags(i).UDTStructure.Name & ")"
End If
TreeView1.Nodes.Add(Node)
'* If the Tag is a UDT, then add the structure definition as a tree node
AddSubNode(Node, AllTags(i).UDTStructure)
Next
End Sub
Private Sub AddSubNode(node As TreeNode, UDTstructure As AdvancedHMI.Drivers.CIP.CLXTemplateObject)
If UDTstructure IsNot Nothing Then
For i = 0 To UDTstructure.Members.Count - 1
Dim SubNode As New TreeNode(UDTstructure.Members(i).Name)
node.Nodes.Add(SubNode)
'* If the member is a UDT, then recursively add the UDT structure as a sub node
AddSubNode(SubNode, UDTstructure.Members(i).SubTemplate)
'* If the member is an array, then add the element count in brackets
If UDTstructure.Members(i).ArrayElements > 0 Then
SubNode.Text &= " [" & UDTstructure.Members(i).ArrayElements & "]"
End If
'* If the member is another UDT, then add the name in parentheses
If UDTstructure.Members(i).SubTemplate IsNot Nothing Then
SubNode.Text &= " (" & UDTstructure.Members(i).SubTemplate.Name & ")"
End If
Next
End If
End Sub