Hi All,
I am getting following error when tryint the Value at line # 4 in below code.
System.InvalidProgramException: Failed to load 'PI Point'
Plug-In: Could not load file or assembly 'OSIsoft.AF.Asset.DataReference.PIPoint, Version=2.0.4.2025, Culture=neutral, PublicKeyToken=6238be57836698e6' or one of its dependencies.
Failed to grant permission to execute.
(Exception from HRESULT: 0x80131418)>> Execution permission cannot be acquired.
at OSIsoft.AF.AFPlugIn.CreateInstance() in d:\Dev\PIAF\Foundation20\SDK\AFPlugIn.cs:line 764
at OSIsoft.AF.AFPlugIn.CreateDataReferenceInstance(AFObject context, String configString)
in d:\Dev\PIAF\Foundation20\SDK\AFPlugIn.cs:line 338
c# Code
1) AFElement elem = myAFDB.Elements["Test"];
2) AFAttribute attr = elem.Attributes["BHT"];
3) AFDataReference attrDR = attr.DataReference;
4) OSIsoft.AF.Asset.AFValue afvalue = attr.GetValue();
5) this.txtTagName.Text = attrDR.ToString();
6) this.txtTagValue.Text = afvalue.Value.ToString();
7) this.lblTagUnit.Text = afvalue.UOM.ToString();
8) this.txtTimeStamp.Text = afvalue.Timestamp.ToString();
Our PI AF databse in one computer and PI Points in different computer. This code is workig fine when AF and PI Points are in same machine.
Any idea? would appreciate any help on this matter.