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 of how to use the Drag Reducing Agent (DRA) Injector Setpoint Management Programmatic Interface

Example of how to use the Drag Reducing Agent (DRA) Injector Setpoint Management Programmatic Interface

  • Last UpdatedApr 24, 2025
  • 1 minute read

Example of how to use the Drag Reducing Agent (DRA) Injector Setpoint Management Programmatic Interface

The following is an example of how to use the Drag Reducing Agent (DRA) Injector Setpoint Management Application Program Interface (API).

Where:

  • The value added into the ProductTypeCode list ("SW") needs to match the Product Type Code Source field of the DRAInjectorGroup record in the Advanced Database Editor (ADE).

  • The value added into the DraInjectorProductGroupName ("Group_1") needs to match the External Reference Code field of the DRAInjectorGroup record in ADE.

    using OASySDNA.Common.Logging;

    using OASySDNA.LMS.DraSetpoints.Abstractions.Manager;

    using OASySDNA.LMS.DraSetpoints.Abstractions.Manager.Options;

    using System.Collections.Generic;

    namespace Example {

    public class Example

    {

    public void ExampleDraLineManagerCall() {

    var productGroup1 = new DraInjectorProductGroup("Group_1");

    productGroup1.ProductTypeCodes.Add("SW");

    productGroup1.ProductTypeCodes.Add("SYN");

    var productGroup2 = new DraInjectorProductGroup("Group_2");

    productGroup2.ProductTypeCodes.Add("MSB");

    var draInjectorProductGroups =

    new List<DraInjectorProductGroup>

    { productGroup1, productGroup2 };

    var draInjectorFlowRateRanges =

    new List<DraInjectorFlowRateRange> {

    new DraInjectorFlowRateRange("1500"),

    new DraInjectorFlowRateRange("1700")

    };

    var draInjectorSetpointGroup =

    new DraInjectorSetpointGroup();

    draInjectorSetpointGroup.DraInjectorName = "Injector1";

    draInjectorSetpointGroup.DraInjectorSetpoints.Add(

    new DraInjectorSetpoint {

    DraInjectorProductGroupName = "Group_1",

    DraInjectorFlowrateName = "1500",

    Value = 10

    });

    draInjectorSetpointGroup.DraInjectorSetpoints.Add(

    new DraInjectorSetpoint {

    DraInjectorProductGroupName = "Group_2",

    DraInjectorFlowrateName = "1700",

    Value = 20

    });

    IDraLineManagerResult managerResult;

    using (var dataContext = new LMSDataContext()) {

    DraLineManager draLineManager =

    new DraLineManager(dataContext,

    DNALogAdapter.Instance);

    var draLineManagerOptions =

    new DraLineManagerOptions { DraLineName = "Line_1" };

    draLineManagerOptions.DraInjectorProductGroups.AddRange(

    draInjectorProductGroups);

    draLineManagerOptions.DraFlowRateRanges.AddRange(

    draInjectorFlowRateRanges);

    draLineManagerOptions.DraInjectorSetpointGroups.Add(

    draInjectorSetpointGroup);

    managerResult =

    draLineManager.Configure(draLineManagerOptions);

    }

    bool isImportSuccessful = managerResult.Success;

    IReadOnlyCollection<string> errorMessages =

    managerResult.ErrorMessages;

    }

    }

    }