How to get a subscription from the PI Server to get tagname’s alarm state changes using PI SDK?
I would recommend you look into using PI SDK Event Pipes. You can search on this discussion forum and review the webinar located at vcampus.osisoft.com/.../2109.aspx
Steve, Thanks for the link. I download the code and loaded it into visual studio. I was able to compile the code. But when I try to run the code. It failed to launch. I did debug and found it choked on
this.CtlServPickList = new OSIsoft.PISDK.Controls.ServPickList();
Error message “Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))”
Here is the serch result for the topic:
Non-64 bit COM Servers
The specific COM exception that arises from HRESULT 0x80040154 (Class not registered) can occur when a .NET application running on a 64-bit platform attempts to create an instance of a COM coclass that is not 64-bits.
Here is an example in C# :
Object newObj = Activator.CreateInstance(Type.GetTypeFromProgID("MyCOMServer.MyCOMClass"));
If the COM server (that houses the COM coclass with progID "MyCOMServer.MyCOMClass" does not support native 64-bit execution, 'System.Runtime.InteropServices.COMException' can occur.
Please refer to Mayank H Parmar in his Community Content comment entitled "32-bit DLLs on a 64-bit OS" on "Troubleshooting Exceptions: System.BadImageFormatException" (msdn.microsoft.com/.../k7137bfe(v=VS.90).aspx) which provides a solution to this problem.
I am running the example on a windows 7 box. You should be able to reproduce the issue on a windows 7 machine. Can I get a new dll so that I can run the example. Thanks a lot.
@Katherine: PI SDK Controls used to be COM controls and 32-bit only. The 2010 R2 release of PI SDK includes new managed controls. Please make sure you refer to the new OSIsoft.PISDK.Controls assembly and use the OSIsoft.PISDK.Controls.PIServerPickList component.
there is OSIsoft.PISDK.Controls.PISDKCtrlDlg.dll ( Date modified 11/21/2011 ) exists in my C:\Program Files (x86)\PIPC\PISDK\PublicAssemblies. I used that in the project. I can not find OSIsoft.PISDK.Controls.PIServerPickList.dll under C:\Program Files (x86)\PIPC\PISDK directory.
@Katherine: the new (managed) PI Server Pick List belongs to the OSIsoft.PISDK.Controls assembly - not OSIsoft.PISDK.Controls.PIServerPickList.
Either way, all you need to do is right-click on the "Toolbox" in Visual Studio and select Choose Items...
In the dialog that comes up, select PIServerPickList and it should appear at the end of "All Windows Forms".
Adding this component to the form will add appropriate references in your solution.
Hope this helps
I did choose toolbox and make sure PIServerPickList is checked
then I recompile and run the programm. Same error message.
Which PISDK version do you have installed?
What is the output architecture for your project?
If they are not the same, make sure they are by either switching to a x86 application for 32-bit PISDK, or to a x64 for 64-bit PISDK.
It is fixed. The trick is in the project properties->Build. Change Platform target from "any cpu" into x86. Now I can bring up the GUI. Thanks.
Retrieving data ...