After your suggested change it seems to work as long as I only enter addresses to subscribe from in the designer property manager.
I would like to add variables from my code (since number of elements is not working it would be handy to subscribe to arrays by for-loops)
but then it starts making trouble again.
If I add ".var1" and ".var2" in the property manager and then add this code:
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
DataSubscriber21.PLCAddressValueItems.Add(New AdvancedHMIDrivers.PLCAddressItem(".var3"))
DataSubscriber21.PLCAddressValueItems.Add(New AdvancedHMIDrivers.PLCAddressItem(".var4"))
sw.Start()
End Sub
I set a breakpoint and Watch TwinCATCom1.SubscriptionList it looks like this:
(0): ".var1"
(1): ".var1"
(2): ".var1"
(3): ".var2"
(4): ".var2"
(5): ".var2"
(6): ".var3"
(7): ".var3"
(

: ".var4"
The list seems to grow exponantially the more variables I add from code.
In above example I also get 45 insted of 8 or 16 datareturned-events per second with pollrateoverride 500.
This code has the same behaviour:
Public Sub New()
' This call is required by the designer.
InitializeComponent()
Dim PlcAddressItem3 As AdvancedHMIDrivers.PLCAddressItem = New AdvancedHMIDrivers.PLCAddressItem()
Dim PlcAddressItem4 As AdvancedHMIDrivers.PLCAddressItem = New AdvancedHMIDrivers.PLCAddressItem()
PlcAddressItem3.LastValue = Nothing
PlcAddressItem3.NumberOfElements = 1
PlcAddressItem3.PLCAddress = ".var3"
PlcAddressItem3.ScaleFactor = 1.0R
PlcAddressItem3.ScaleOffset = 0.0R
PlcAddressItem3.SubscriptionID = 0
PlcAddressItem4.LastValue = Nothing
PlcAddressItem4.NumberOfElements = 1
PlcAddressItem4.PLCAddress = ".var4"
PlcAddressItem4.ScaleFactor = 1.0R
PlcAddressItem4.ScaleOffset = 0.0R
PlcAddressItem4.SubscriptionID = 0
DataSubscriber21.PLCAddressValueItems.Add(PlcAddressItem3)
DataSubscriber21.PLCAddressValueItems.Add(PlcAddressItem4)
' Add any initialization after the InitializeComponent() call.
End Sub
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
sw.Start()
End Sub