PI-ACE Source Code Migration
To migrate legacy PI ACE source code, the gSharp Developer Kit is required to be installed in addition to Microsoft Visual Studio.
The gSharp Developer Kit does not include a wizard like the PI ACE Wizard for Visual Studio. Simply open the solution or project directly in Visual Studio by double-clicking the solution file (.sln) or using the appropriate option in your version of Visual Studio.
The following steps describe the process for migrating source code using a simple ACE calculation written in VB.NET.
-
Open the Visual Studio solution file for the ACE assembly.

-
Expand the References view in the Solution Explorer window.

-
Add the following assembly references to the project:
GHost.CoreGHost.GSharp.CalculationGHost.GSharp.Calculation.AFGHost.GSharp.CoreGHost.GSharp.Core.AFGHost.GSharp.PI.ACEOSIsoft.AFSDK
-
Remove the references to
OSIsoft.PIACENetandOSIsoft.PISDK.
-
Remove the
Imports OSIsoft.PI.ACEstatement from the ACE module code.
-
Add
Importsstatements forGhost.GSharp.PI.ACEandOSIsoft.AF.Asset.
Compatibility
Several methods in both the PIACEBIFunctions and PIACEPoint classes have updated method signatures in gSharp. These updates reflect the change in object types passed into or received from these methods due to the switch from the PI-SDK to the AF SDK in the gSharp PI ACE compatibility library.
For example, the GetPIModuleFromPath() method in the PIACEBIFunctions class now returns an AFElement object in gSharp, as opposed to a PI Module Database PISDK.PIModule object in PI ACE. Because of this, access to properties such as PIProperties and PIAliases is now via Attributes of the returned Asset Framework AFElement. The following example highlights this.
Retrieving PI Module Database properties in PI ACE

Retrieving Asset Framework attributes in gSharp

Where these methods have changed signatures, depending on your specific usage and coding style, Visual Studio will highlight the relevant pieces of code that reference updated-signature methods within the code editor.