Skip to main content

PI-ACE Context Migration

The PI-ACE Migration app is a command-line application to help users migrate their PI-ACE contexts to gSharp. As specified by the user, the app will scan the PI-ACE context definitions and build the corresponding gSharp context definitions automatically.

This app does not (nor can it) organize the structure of elements required for each context, particularly in the definition of AF attributes. It requires an appropriate PI Asset Framework to be already defined before it can perform its proper function. The most straightforward way of doing this is to set up the PI AF Link subsystem.

Start the Migration App​

The easiest way to run the app is to open a command prompt (click the Start menu and type cmd and press Enter) and change directory to the installation folder of the gSharp server. For example,

cd "C:\Program Files\gHost Technology\gSharp"

Run the app from the command line:

GHost.GSharp.PI.ACE.Migration.exe

The migration app will start by displaying its startup header and then request a gSharp server to connect to.

The ACE migration app starting up in a console window

Select a gSharp Server​

The migration app will display the known gSharp servers in a numbered list. The last item in the list is always New Server.

Enter the number that corresponds to the gSharp server where the contexts are to be migrated to and press <Enter>. If no server number is entered, the server marked as (Default) will be used. If no server is listed (only the New Server option is available), create a new server entry by selecting the New Server number and pressing <Enter>. The app will request the following:

PromptDescription
Server NameThe display name or the machine name of the gSharp server.
IP AddressThe IP address or the machine name of the gSharp server. If no address is entered, the app will try to resolve the Server Name field.
DescriptionA helpful description of the gSharp server.

The ACE migration app adding a new gSharp server to the server list

Select a PI Server​

Once the app connects to the gSharp server it will request a PI server to connect to. This is the server that contains the PI-ACE contexts in its Module Database structure. Enter the server number that corresponds to the PI server where the contexts are to be migrated from and press <Enter>. If no server number is entered, the server marked as (Default) will be used.

The ACE migration app requesting a PI server to connect to

If no PI server is listed there is an issue with the PI client installation. Check the PI-SMT app to make sure that at least one PI server is listed there.

Once connected to a PI server, the migration app will display a numbered list of PI-ACE schedulers found on that server. In most cases, a PI server will have a single PI-ACE scheduler, in which case it will immediately select that single scheduler.

The ACE migration app requesting the assemblies to migrate

If there are multiple schedulers the app will prompt for a scheduler to be selected. Enter the number that corresponds to the required scheduler and press <Enter>. If there are no schedulers found on the PI server there will be an error displayed and the migration app will stop.

Select Assemblies for Migration​

Using the list of available assemblies to be migrated, make a selection by specifying:

  • <Enter>, 0 or all
  • A comma-separated list of assemblies. The list may contain the following:
    • The name of an assembly as listed (e.g. so2concentration), including wildcards * and ?.
    • The number that corresponds to an assembly (e.g. 1).
    • A range in the form of First-Last that corresponds to a subset of assemblies. The First or Last item in a range can be a number or an assembly name (e.g. 1-2 or 1-TimeToOverflow). The order is not important, meaning that 7-4 is equivalent to 4-7.

If the app encounters a 0 or all in the comma-separated list, this will supersede all other entries in the list. Selected assemblies will only be processed once, so if more than one assembly is entered or multiple ranges overlap, the duplicates will be ignored. For example, if 1,6,6,3-7,5-8 was entered, this specifies the list 1,6,6,3,4,5,6,7,5,6,7,8; the list would be reduced to 1,6,3,4,5,7,8.

note

The app gives hints as a brief summary of the above description.

If the range entered is in error or returns no assemblies, the app will indicate this and request a retry:

The ACE migration app requesting assemblies after an invalid request

When a range of assemblies is successfully selected the app will display the list of selected assemblies, together with their modules and points.

The ACE migration app displaying the selected assemblies and their modules

As shown in the image above, assembly modules are listed beneath the assembly they belong to and indented. Each module includes a list of the points it contains, including an (I) or an (O) indicator to show whether they are an input or an output point.

To accept the list of assemblies enter Y or y, then <Enter>. Enter N or n, then <Enter> to reject the current assembly list and reselect assemblies again.

Any other value entered will be deemed to be the same as entering N.

Assembly Compatibility​

When PI-ACE assemblies have been selected and confirmed, the app will compare those assemblies with the assemblies that are registered with gSharp.

For each PI-ACE assembly:

  • If a corresponding gSharp assembly is found and is compatible, the app will log a simple message:

    • The PI-ACE assembly 'Aaaaa' is compatible with the corresponding assembly in gSharp and will be migrated.
  • If a gSharp assembly is not found or is found but has incompatibilities it will log that the assembly has compatibility errors and then log the errors it found. The most common of these errors are:

    • A registered assembly named 'Aaaaa' could not be found in gSharp.
    • The 'Mmmmm' PI-ACE module could not be found in the corresponding gSharp assembly.
    • The 'Input/Output' data direction of the 'Ppppp' point of the 'Mmmmm' PI-ACE module does not match the 'Input/Output' data direction of the corresponding gSharp module.
    • The 'Ppppp' point of the 'Mmmmm' PI-ACE module could not be found in the gSharp 'Mmmmm' module.

The ACE migration app displaying the selected assembly compatibility errors

The options available at this point are:

    1. Process all assemblies, ignoring incompatible modules

    This option directs the app to process all assemblies as much as it can, processing only compatible modules. If a module is incompatible or missing it will not be processed.

    2. Process only compatible assemblies

    This option directs the app to write only the assemblies that are 100% compatible. If any module in an assembly was reported to have compatibility errors, that assembly will not be processed.

    3. Cancel

    This option will stop the migration app and not process any assemblies.

Prepare Assemblies​

When options 1 or 2 are selected the app requests the full path to the root AF element that represents the PI Module Database root. This is the AF element that contains the same structure of elements that match the assemblies and contexts stored in the PI Module Database.

The SO2 Station 1 definition in the PI Module Database and in the Asset Framework

In the above example the root AF element is ModuleDB because that is where the ACE_Calculations element is, which has the same structure as the modules in the PI Module Database that the PI-ACE contexts are mapped to.

When the root path has been entered the app will verify that it is a valid path by contacting the AF server. Once the path is verified the app will then proceed to prepare the context data for all selected valid contexts. It will list these so they can be inspected before actually creating them in gSharp.

The ACE migration app displaying the verified path and some of the prepared module and context data

As part of the preparation phase, the app also attempts to resolve the path and points of each prepared gSharp context. If any do not resolve correctly an error will be displayed.

The ACE migration app displaying the verification path and some of the prepared module and context data

The list generated by the app while preparing data is organized by module. For each module it shows the attribute path that will be assigned to each module point. It also shows each context with the name it will be given in gSharp and the AF element path that will be assigned to it.

At this point the migration will still run, but the unresolved context path and points will be added to gSharp as they are, and gSharp will also not be able to resolve them. In this case they can be manually edited in the gSharp Administration app.

Write Contexts to gSharp​

Now that modules and contexts are prepared and verified they can be written to gSharp. The data written to gSharp is specified in the following table:

Data TypeDescription
Point DescriptorThe relative path of an AF attribute. It is relative to the AF element described by the context.
Context DescriptorThe absolute full path to the AF element that represents the context.
Context ScheduleThe type and parameters of each context's schedule. Note that PI-ACE has only one schedule per context to be migrated.
Run StatusThe run status of each module and context is migrated. Note that PI-ACE does not support schedule-based run status and so the gSharp default value of Running is used.

Migrating the above data may have conflicts with existing gSharp data. Because of this, three options are available. With each option, any existing module point descriptors will be overwritten with the point definitions found in PI-ACE.

    1. Remove existing contexts and migrate each assembly

    For each module being migrated, removes all contexts associated with that module before writing the migrated contexts. This is likely the most practical option as it creates a clean migration. This is especially useful if there is a need to apply the migration multiple times after having made adjustments.

The ACE migration app displaying the progress of writing to gSharp

    2. Write over existing contexts

    Before writing a context, a search is done for an existing context of the same module with the same descriptor (AF element path). If an existing context is found it is removed before the migrating context is written.

The ACE migration app displaying the progress of writing to gSharp

    3. Leave existing contexts and only write new ones

    Before writing a context, a search is done for an existing context of the same module with the same descriptor (AF element path). The migrating context is only written if an existing context is not found.

The ACE migration app displaying the progress of writing to gSharp