8 Replies Latest reply on Oct 4, 2012 9:31 PM by kathye

    how to get tag state change programmatically

    kathye

      How to get a subscription from the PI Server to get tagname’s alarm state changes using PI SDK?

        • Re: how to get tag state change programmatically

          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

            • Re: how to get tag state change programmatically
              kathye

              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.