11 Replies Latest reply on Jun 26, 2017 3:32 PM by cjrancur

    How can I update PI connections from vb.net PI SDK to AF SDK?

    cjrancur

      How can the OSIsoft.AF reference be added to an existing VB.net 2010 application?

       

      I am updating a 15 year old application that was running on an old XP machine. We need to retain the old XP machine in order to keep the current serial port connections that are being used on that older hardware.

       

      I have installed the AF SDK on the PC where I am rewriting the executable, but I can't find any reference to AF in either the COM or NET tabs of the Add Reference dialog.  The C version of sample code on Github mentions an application extension for OSIsoft.AF.  Does an application extension in C translate to a COM or a NET reference, in vb.net terms?  Does the AF SDK require Visual Studio 2012? I know that VB 2010 works on XP, but does Visual Studio 2012 work on an XP PC?

       

      Thank you for helping me with these beginner's baby steps toward getting this update work started,

      Carrie

        • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
          Rick Davin

          Hi Carrie,

           

          Yes, AF SDK requires a minimum of Visual Studio 2012.  However, this link on AF System Requirements states that Windows XP is not supported for AF Client.

          1 of 1 people found this helpful
            • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
              cjrancur

              Thanks Rick,

               

              I still have a developmental XP PC also, so I am considering downloading VS 2012 to test the AF against the XP machine.  I wonder if the "not supported" for XP means that it is known that AF SDK will not work with WinXP, or could it reflect OSIsoft's understandable choice to no longer support XP starting several months after Microsoft stopped supporting XP in any form? Someday, for this project, we will need to move beyond Windows XP, and I don't want to re-write on deprecated PI SDK if I can help it, because that means that later another re-write step may be needed when (and if) the older PI SDK is no longer supported.

               

              Do you, or others, have comments about whether it is worth the attempt to build AF SDK applications for an XP box using VS2012? A rewrite is needed with urgency, so I don't want to waste too much time trying things that others have already tried, if there is no chance that it will work. The rewrite has become necessary because we moved to OSIsoft recommended security, and the older application that needs to be re-written uses PI explicit logins with trusts, rather than Active Directory logins. I could also write PI SDK implicit login code, but then someone may have to rewrite this again in the future, if PI SDK is no longer supported.

                • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
                  Rick Davin

                  Additional links:

                   

                  AL00263 Microsoft Phasing Out Windows XP

                   

                  KB01161 When a WIndows OS Reaches End of Life: What it means to the PI System

                   

                  I think you are wise and prudent for thinking of your code base, and that does mean making the switch to AF SDK sooner than later.  AF 2.9 will be released next month, and installs with .NET 4.6.  Plus Visual Studio 2017 was released in March.  A lot of pieces have been upgraded many times since Visual Studio 2010.

                   

                  You may try to install AF Client on Windows XP.  If it works, then you app can run but technically is an unsupported OS. 

                   

                  Here's a blurb from the AF release notes:

                   

                  Visual Studio 2012 or later is required to develop applications with the PI AF SDK that utilize the Rich Data Access features. These applications must target .NET 4.5.2 (or later). A version of the AF SDK that is compatible with .NET 3.5, as well as Visual Studio 2008 and 2010 is also supplied, but does not encompass all the functionality of the .NET 4 AF SDK. Applications built against the 2.5.x (2012) version of the AF SDK targeting .NET 4 will continue to work with this version. If .NET 3.5 is not installed, the .NET 3.5 AF SDK and AF UI components will not be functional.

                   

                  What functionality is not encompassed with the .NET 3.5 AF SDK version?  The entire OSIsoft.AF.PI namespace for one.

                  1 of 1 people found this helpful
                    • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
                      cjrancur

                      I found that the last .net framework supported on WinXP was 4.0, per the below .Net blog.

                      .NET Framework 4.5 and Windows XP | .NET Blog

                       

                      I also found that the web downloader for VS2012 does not work on WinXP.  That wasn't nice, Microsoft. I read the readme file to find out, but it didn't say.

                       

                      My  next step is to find the AF SDK versions for .net 4.0 or lower.  I wish I knew of an easier way to determine last versions of PI software for various OS and .net framework versions.  The only way I know is to peruse release notes from OSIsoft, or bug TechSupport.  It sure would be handy if a downloadable file or web app were maintained with that info from OSIsoft.  Is there such a bird?  Sure would be a timesaver.

                        • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
                          cjrancur

                          I found that AF 2012 SP2 worked with AF4.0 and with XP. I have it installed on my XP dev machine.

                           

                          Now I wonder if I can install two versions of the AF SDK on the same PC for development on Win7? I need the current SDK for some applications, but also I can develop with various versions of Visual Studio on a single PC.  If this is possible, are there any "gotcha's" to watch out for so that an install of an older SDK doesn't cause trouble for the previously installed newer SDK on a single dev machine?

                            • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
                              cjrancur

                              I didn't find AF SDK in my VS2010 version on the dev XP machine, so I installed AF2012 SP2.  (I know, calling a Windows XP box a development machine is a bit of a stretch >> ...............<<<, still what else do I call it?). The install file finished in one second, saying that I had that version or newer already installed. So, is this like the ACE 2.0 version, which is named like ACENet or something, although the library added is named differently, without the "net" wording?  What is the name of the reference library I need to add to use AF 2012 SP2 in VS2010 in VB.net.  Would I be looking for a .COM or a .NET file?  Might I need to uninstall a higher version of AF, before I find this version for VS2010 on my Windows XP dev machine?

                              • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
                                Rick Davin

                                Yes you can have multiple Visual Studio versions on the same box.

                                 

                                There is a trick to having multiple AF SDK versions FOR DEVELOPMENT.  I'll have to search my notes on that but I've done it before.

                                  • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
                                    Rick Davin

                                    Hi Carrie,

                                     

                                    Here's an old thread where I mention that its possible to have multiple versions of AF SDK loaded purely for development work.  To hit the highlights:

                                    • You can only have one AF SDK version active on your machine as THE version of AF. Any use of OSIsoft tools such as PSE or SMT will use this version.
                                    • Before you upgrade to new AF versions, you can copy the current version's %PIHOME%\AF\PublicAssemblies folder someone safe.
                                    • My destination is usually in documents\AFSDK Versions.  I copy the entire PublicAssemblies folder and then rename it to something like AF 2.8.0.7444.
                                    • Then if any Visual Studio project needs development for a specific older version, I load the AFSDK from the AFSDK Versions folder and not %PIHOME%\AF\PublicAssemblies.

                                     

                                    Remember you want to use the .NET 4 libraries and not the .NET 3.5 libs so that you have access to the OSIsoft.AF.PI namespace as well as any Rich Data Access (RDA) methods.  Since you want to work with PIServer, PIPoint, and perhaps PIPointList objects, the OSIsoft.AF.PI namespace is quite important towards that endeavor.

                                    2 of 2 people found this helpful
                        • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
                          cjrancur

                          Guess I've been talking to myself.  Carrie Rancuret (to Carrie Rancuret). So I marked this as not helpful, to deduct some points from myself. Happy afternoon!

                          • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
                            gachen

                            Good on you for taking the initiative on a task like this. I'm sure overhauling a business application that has been around for 15+ years can't be easy.

                             

                            First, we have the constraint of running the software on Windows XP. Okay, so this tells us that the latest version of .NET (which AFSDK is built on), which the application can target is .NET version 4, since this is the latest version of .NET supported on Windows XP. Now that we've determined which version of .NET to target, we can see that VS2010 is perfectly suitable, since by default it targets .NET 4. This also means that the latest version of AFSDK that we can use is version 2012 SP2, as this is the last to target .NET 4. Subsequent versions also include a .NET 3.5 library, but you will want to use AFSDK targeting .NET 4, as this introduces some namespaces which are not accessible to .NET 3.5. Once you have this installed on your VS machine, you should be able to find the reference in the .NET tab as OSIsoft.AFSDK (make sure you choose the v4 reference).

                             

                            Good luck!

                             

                            Edit: Sorry, I wrote up this response and forgot to post it, so some content is redundant with what you may have already discussed.

                            1 of 1 people found this helpful
                            • Re: How can I update PI connections from vb.net PI SDK to AF SDK?
                              cjrancur

                              I found that the AF SDK required a higher version of .net framework, compared to .net framework 2.0 used previously.  So, I was unable to locate the AF SDK library within ACE, or within any application where the .net framework library was not set to a high enough version within the project.  When the framework version was set high enough, then the AF SDK libraries were exposed for use.