Hello,
I am trying to pass tag name as string and trying to write the tag value, but facing an error "Object reference not set to an instance of an object".Is there any dll which I have to add to my project files.Please Tell me what I am doing Wrong.Below is my code
namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;
using System.IO; // for ApplicationPath
using System.Reflection; // for ApplicationPath
using Neo.ApplicationFramework.Tools.OpcClient;
public partial class Screen1
{
void Button1_Click(System.Object sender, System.EventArgs e)
{
var myTag = GetGlobalDataItem("value1");
myTag.Value = 123;
}
private GlobalDataItem GetGlobalDataItem(string propertyName)
{
PropertyInfo tagProperty = typeof (Neo.ApplicationFramework.Generated.Tags).GetProperty(propertyName);
if(tagProperty == null)
return null;
else
return tagProperty.GetValue(Globals.Tags, null) as GlobalDataItem;
}
private string ApplicationPath
{
get { return Path.GetDirectoryName(Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName); }
}
}
}