Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA Pipeline Operations for Liquids

Example implementation

  • Last UpdatedApr 24, 2025
  • 2 minute read

In our example code, we extended the pipe_segment table to include five custom fields (heatxfer, specheat, segment_aL, ups_temp_aL, and dns_temp_aL) and illustrate how to read and store values into them. The same practice can be used for other Batch Tracking tables, such as the pipeline and fragment tables.

To extend the RealTime database schema, you can create a schema extension .json file that includes the extra fields you want to include. Refer to the following pipeSegment_table_override.json example.

{

"name": "pipe_segment",

"fields": [

{

"name": "heatxfer",

"type": "double",

"description": "Custom heat transfer value"

},

{

"name": "specheat",

"type": "double",

"description": "Custom specific heat value"

},

{

"name": "segment_aL",

"type": "double",

"description": "Custom average segment alpha length value"

},

{

"name": "ups_temp_aL",

"type": "double",

"description": "Custom upstream segment alpha length value"

},

{

"name": "dns_temp_aL",

"type": "double",

"description": "Custom downstream segment alpha length value"

}

]

}

Place the file in %DNADataRoot%\RealTime\database\schema\tables\your_table_override_file_name.json.

Note: The name of the file does not matter if it does not conflict with an existing file in the same directory.

When naming your extended fields, make sure they do not conflict with any fields in the baseline schema. Consider adding a special prefix or suffix to your field names to ensure they do not conflict with baseline fields that may be added in the future. For a complete sample implementation, refer to C:\dev\RealTime\source\Pipeline.Linepack.Extension.Example\pipelineLinepack.cpp.

Upgrading the Batch Tracking (BT) file to specify the Custom Linepack Calculation Method

The LINEPACKMETHOD field in the BT file is the extension point used to specify a custom linepack method for a pipeline. If your BT file is using the LINEAR field, you will have to upgrade to the LINEPACKMETHOD field. You can do this by manually removing the LINEAR attribute from the BT file and adding the LINEPACKMETHOD attribute. Alternatively, you can use a PowerShell script that has been prepared to perform this step automatically. The following steps show you how to upgrade the BT file using the PowerShell script.

  1. Back up your BT file before beginning the upgrade (should you want to revert later).

  2. On the desktop, double-click the Windows PowerShell for DNA shortcut.

    Windows PowerShell for DNA opens.

  3. Assuming one of your BT files is located in C:\Temp\MyBTFile.BT, execute the following command:

    PS C:\Program Files\AVEVA\DNA\RealTime\scripts\UpgradeScripts\manual> .\Update-BTFile-LinepackMethod.ps1 C:\Temp\MyBTFile.BT

  4. Open the BT file within a text editor. The following lines should appear:

    ; LINEAR: TRUE ; Deprecated by script

    LINEPACKMETHOD: linear ; Added by script

  5. For the LINEPACKMETHOD attribute, change the value linear to the name of the lpackalg enumeration that is mapped to the method. Using the example above, if we want to use the do_custom_linepack method, we would assign AT_LINEPACK_PLUGIN_METHOD_1 to LINEPACKMETHOD because that is how they are mapped in LMS_Extensions_BatchTracking_Linepack_Map.json.

    ; LINEAR: TRUE ; Deprecated by script

    LINEPACKMETHOD: AT_LINEPACK_PLUGIN_METHOD_1; Added by script

  6. Save to commit your changes.

    Note: LINEPACKMETHOD and LINEAR cannot be used together within a BT file. If both fields are defined, Batch Tracking Compiler (BTC) execution will result in an error state.