using an example from the forum I added the following code to catch the change event on a group of internal tags:-
using System;
using System.Windows.Forms;
namespace ProjectAddin
{
[System.AddIn.AddIn("ThisProject", Version = "1.0", Publisher = "", Description = "")]
public partial class ThisProject
{
zenOn.IOnlineVariable obOnlineVar = null;
private void ThisProject_Startup(object sender, EventArgs e)
{
obOnlineVar = this.OnlineVariables().CreateOnlineVariables("Container");
obOnlineVar.Add("CDS_Intern_Variable_UINT_1");
obOnlineVar.Add("CDS_Intern_Variable_UINT_2");
obOnlineVar.Add("CDS_Intern_Variable_UINT_3");
obOnlineVar.Add("CDS_Intern_Variable_UINT_4");
obOnlineVar.Define();
obOnlineVar.VariableChange += new zenOn.VariableChangeEventHandler(obOnlineVar_VariableChange);
}
void obOnlineVar_VariableChange(zenOn.IVariable obVar)
{
System.Diagnostics.Debug.Print("My event is triggered by: " + obVar.ToString());
throw new NotImplementedException();
}
private void ThisProject_Shutdown(object sender, EventArgs e)
{
obOnlineVar.VariableChange -= new zenOn.VariableChangeEventHandler(obOnlineVar_VariableChange);
obOnlineVar.Undefine();
obOnlineVar = null;
}
I added a numeric value to a screen so I could test it and when I make a change to one of the variables a message box pops up with no information in it. How's this happening
Thank You
This is a migrated post! Originally posted on 06.11.2012 by user conradsmith. Please be aware that information can be outdated.