Here is an example of the proper way to use subscriptions using code:
'* Save the ID of the subscription for later unsubscribing
Private SubscriptionID As Integer
'* Subscribe to the Tag
Private Sub MainForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
SubscriptionID = EthernetIPforCLXCom1.Subscribe("MyTag", 1, 250, AddressOf SubscribedDataReturned)
End Sub
'* Show the value when it is returned
Private Sub SubscribedDataReturned(ByVal sender As Object, ByVal e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)
Me.Text = e.Values(0)
End Sub
'* When the form is closed be sure to unsubscribe so the driver doesn't keep trying to read the data
Private Sub MainForm_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
EthernetIPforCLXCom1.UnSubscribe(SubscriptionID)
End Sub
The DataSubscriber is designed to encapsulate this complexity. You simply add a DataSubscriber to the form, put the tag name in PLCAddressValue, then double click he DataSubscriber to get back to the event handler for data that was returned.