Data Store Configuration
Now that we've established what our calculation is going to look like, we need our data store to reflect that. To do this we need to set up some assets to run the calculation against. Here is a sample configuration of assets that can be used with our calculation:
- PI Asset Framework
- Canary Asset Hierarchy

It is presumed that you have a good understanding of the AVEVA PI System and its Asset Framework and are able to establish these without guidance.

It is presumed that you have a good understanding of the Canary system, its Virtual Views, and its Asset Hierarchy and are able to establish these without guidance.
In a typical development workflow for a real system of calculations, the data store would be configured before developing a gSharp assembly.
Correlation Between .NET Modules and the Asset Data Store
Once you have created your calculation class and configured your assets in the asset data store (PI AF or Canary), gSharp provides the bridge between the two. This relationship is managed through a structured set of gSharp entities: the module, its points, and the contexts that connect those points to real asset data.
- PI Asset Framework
- Canary Asset Hierarchy


From .NET to gSharp
When your calculation assembly is registered, gSharp identifies your TankVolume class as a module. Each property in your class that derives from any of the standard gSharp point base types (for example, AFAttrDoublePoint or CLDoublePoint) becomes a point within the module.
- PI Asset Framework
- Canary Asset Hierarchy


Module points are descriptive only—they define the data that the calculation expects (such as Diameter, Level, and Volume) but are not tied to any specific asset or attribute.
Within the module's metadata, each point includes mapping details that describe how it should be resolved once the module is connected to an asset. For example, the TankVolume module might specify that its Diameter point corresponds to Diameter_cnst when bound to an asset.
Contexts: Connecting Modules to Assets
A context represents a specific instance of a module connected to a particular asset in the data store. Each context resolves the module’s points to the correct asset attributes based on both the module’s point descriptors and the asset’s configuration.
- PI Asset Framework
- Canary Asset Hierarchy


Although the module’s code and points are the same, each context links them to a different asset, allowing the same calculation logic to run independently for each tank.
gSharp Overview
The screenshot below shows how the TankVolume module, with its points and contexts, is represented in the gSharp administration application. The selected module and its associated contexts are highlighted to provide a visualization of how the mappings and relationships you explored in the examples appear in the system.
- PI Asset Framework
- Canary Asset Hierarchy

