8 Replies Latest reply on Aug 15, 2011 1:32 PM by pcombellick

    can i use PI sdk with VC++?


      I want to use C++ in PI SDK to improve the performance.
      But the current examples of PI SDK development are all VB or C# programming.


      Can I use PI SDK with C++?
      I try to import the DLLs  in VC as the follows.
      #import "PISDKcommon.dll"
      #import "PITimerServer.dll"
      #import "pisdk.dll"


      But the last two DLLs can not be read in when compiling.
      What should I do to resolve the problem?



        • Re: can i use PI sdk with VC++?

          Hi Nobuo,


          Yes the PI SDK can be used in C++ as well. There are not as many examples for using PI SDK in C++ here but there is an example code in the PI SDK Programming Reference that illustrates the use of PI SDK in C++, for adding a PIUser programmatically. 


          Can you let us know what are your programme should be doing? What is the performance you are getting now, and perhaps how you have written the software? Perhaps we can help you take a look and see if there is anyway the program can be optimized before converting to C++?


          Anyway looking at your code snippet, there is a typo for importing PITimeServer, because of an additional 'r'. It should be:

          import "PITimeServer.dll"

          The import statement for pisdk.dll is correct, what is the error that you are getting on compilation?


          Note: I am moving this thread to the PI SDK Development forum, so that other users who are active in PI SDK development can chime in as well.

            • Re: can i use PI sdk with VC++?



              can you let us know what performance issues you are experiencing that makes you move to C++?

                • Re: can i use PI sdk with VC++?



                  Thank you for your kind help.


                  I have no experence with COM programing, so I faild to add DLL to my C++ project. After registering these DLLs, I found they can be added without errors.


                  I have implemented a demo to get data from PI system every 100ms with VB, it is very heavy to execute. So I think it may become faster to change the program from VB to C++ or C#. I was told that C++ is several times faster than C#.



                    • Re: can i use PI sdk with VC++?

                      Nobuo - C++ might be faster than .net, but this comes at a price.


                      If you are demoing retrieval of data from PI every 100ms - what is the final purpose? As you know PI is not a control system so querying the system every 100ms might not return the result you want.


                      Imagine that PI is also used in high latency applications where the network latency could be much higher than 100ms.