Subscriptions to PLCAddresses are created at runtime, that's why it works when you enter it manually.
Changing PLCAddress via combo box will not trigger new subscription.
Here is a temporary fix that's applicable only for what you are trying to do:
1) Change your code to this:
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedItem = "Iген. (А)" Then
ChartBySampling1.PLCAddressItems.Item(9).PLCAddress = ("F428731")
ChartBySampling1.SubscribeToComDriver(9, "F428731")
BasicLabel44.PLCAddressValue = ("F428731")
End If
If ComboBox1.SelectedItem = "out FCR" Then
ChartBySampling1.PLCAddressItems.Item(9).PLCAddress = ("F429285") 'df307
ChartBySampling1.SubscribeToComDriver(9, "F429285")
BasicLabel44.PLCAddressValue = ("F429285")
End If
If ComboBox1.SelectedItem = "out AVR" Then
ChartBySampling1.PLCAddressItems.Item(9).PLCAddress = ("F429325") 'df327
ChartBySampling1.SubscribeToComDriver(9, "F429325")
BasicLabel44.PLCAddressValue = ("F429325")
End If
Label69.Text = ChartBySampling1.PLCAddressItems.Item(9).PLCAddress
End Sub
2) Change SubscribeToComDriver sub, inside the ChartBySampling, to this:
Private SubscriptionsCreated As Boolean
Private additionalSubscriptionsCreated As Boolean
Public Sub SubscribeToComDriver(Optional ByVal indx As Integer = -1, Optional ByVal plcAddress As String = "")
If Not DesignMode And IsHandleCreated Then
If indx <> -1 AndAlso plcAddress <> "" AndAlso SubscriptionsCreated Then
If additionalSubscriptionsCreated Then
SubScriptions.SubscriptionList.RemoveAt(SubScriptions.SubscriptionList.Count - 1)
SubScriptions.SubscribeTo(m_PLCAddressItems(indx).PLCAddress, m_PLCAddressItems(indx).NumberOfElements, AddressOf PolledDataReturned, m_PLCAddressItems(indx).PLCAddress, 1, 0)
Else
SubScriptions.SubscribeTo(m_PLCAddressItems(indx).PLCAddress, m_PLCAddressItems(indx).NumberOfElements, AddressOf PolledDataReturned, m_PLCAddressItems(indx).PLCAddress, 1, 0)
additionalSubscriptionsCreated = True
End If
Exit Sub
End If
If Not SubscriptionsCreated Then
'* Create a subscription handler object
If SubScriptions Is Nothing Then
SubScriptions = New SubscriptionHandler
SubScriptions.Parent = Me
AddHandler SubScriptions.DisplayError, AddressOf DisplaySubscribeError
End If
SubScriptions.ComComponent = m_ComComponent
Dim index As Integer
While index < m_PLCAddressItems.Count
If Not String.IsNullOrEmpty(m_PLCAddressItems(index).PLCAddress) Then
SubScriptions.SubscribeTo(m_PLCAddressItems(index).PLCAddress, m_PLCAddressItems(index).NumberOfElements, AddressOf PolledDataReturned, m_PLCAddressItems(index).PLCAddress, 1, 0)
End If
index += 1
End While
SubscriptionsCreated = True
End If
SubScriptions.SubscribeAutoProperties()
End If
End Sub
You can see in the attached picture how the graph for series10 (which is series(9)) is changing as the combo box selection is changed.
I set register values for "Iген. (А)" / "out FCR" / "out AVR" to: 2.2225 / 0.75 / 0.
Unless Archie decides to implement some changes, you will have to stick with this temporary fix or change your project to work with the original ChartBySampling control.