I'm not sure how well this will work with WPF, but here is an example of how to use Subscribe via code:
Private SubscriptionID1 As Integer
Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
SubscriptionID1 = EthernetIPforCLXCom1.Subscribe("MyTag", 1, 500, AddressOf Subscription_DataReceived)
End Sub
Private Sub Subscription_DataReceived(sender As Object, e As Drivers.Common.PlcComEventArgs)
Label1.Text = e.Values(0)
End Sub
Private Sub MainForm_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
EthernetIPforCLXCom1.UnSubscribe(SubscriptionID1)
End Sub
I would like to test it with C# code the code which I am trying to implement is
public int subscriptionID1;
public SerialDF1forSLCMicroCom plc = new SerialDF1forSLCMicroCom();
private void btnStartTriggers_Click(object sender, RoutedEventArgs e)
{
subscriptionID1 = plc.Subscribe ("N7:4", 1, 500,
);
plc.SubscritionDataRecived += plc_SubscritpionDataRecieved;
}
void plc_SubscriptionDataReceived(object sender, MfgControl.AdvancedHMI.Drivers.Common.SubscriptionEventArgs e)
{
lblDataSubcribe.Content = e.Values(0);
}
What I should put as a AddressOf Subscription_DataReceived ?
Thanks Archie