Synchronously execute a Business Logic Tier (BLT) component using the Data Access Layer (DAL)
- Last UpdatedApr 08, 2026
- 2 minute read
This scenario guides you through the steps required to synchronously execute the TestBLT Business Logic Tier (BLT) component using the Data Access Layer (DAL) .
To identify the code associated with each step, see the code comments in the Example code section.
The TestBLT component is called using the following input parameters:
- table and point names
- numberOfAlarms
The TestBLT component returns the following outputs:
- numberOfAlarms parameter
- numberOfEvents parameter
- table and point names are returned as a tabular result or dataset
Tosynchronouslyexecute the BLT component using the DAL
- Open the Program.cs file from the created project.
In this example, the project is named DALBLTTest and the BLT component is named TestBLT.
- Create a method to execute the BLT component by doing the following:
- Get a DALBLTConnection to the driver where the BLT component is hosted. For example, RealTime.
- Create the BLT component parameters, providing initial values for the input parameters and ouput variables for the output parameters.
- Execute the BLT component synchronously.
- Retrieve the result data.
- Retrieve the output values of the parameters.
- On the Main method, do the following:
- Initialize the DAL client service layer.
- Call the BLT component execution method.
- Run the DALBLTTest.exe to check the TestBLT component execution by doing the following:
- On the desktop, double-click the Windows PowerShell for DNA shortcut.
- Execute the following commands:
set-silo RealTime
dalblttest
Example code
private static void SynchronousExecute()
{
// Get a DALBLTConnection to the driver.
var bltConnection = DALBLTClient.GetGlobalConnection("Realtime", null);
// Create the BLT component parameters.
var bltParameters = new List<DALBLTParam>
{
new DALBLTParam(name:"point", value:"0analog", isOutput: false),
new DALBLTParam(name:"table", value:"analog", isOutput: false),
new DALBLTParam(name:"numberOfAlarms", value:100, isOutput: true),
new DALBLTParam(name:"numberOfEvents", value:null, isOutput: true),
};
var bltValues = new List<DALBLTParam>();
const String bltName = "TestBLT";
const Int32 maxRowsToReturn = 0; // unlimited rows.
// Execute the BLT component synchronously.
if (!bltConnection.ExecuteSync(
bltName,
maxRowsToReturn,
bltParameters,
out bltValues,
out Int32 rowsAffected,
out DataSet data,
out DALBLTExecutionStatus execStatus,
out String failureReason))
{
Console.WriteLine(quot;BLT execution failed due to: {failureReason}");
return;
}
// Retrieve the result data.
var table = data.Tables[0];
foreach (DataRow row in table.Rows)
{
var name = row[0].ToString();
var value = row[1].ToString();
Console.WriteLine(quot;The result with field {name} has value {value}");
}
// Retrieve the output values of the parameters.
foreach (var value in bltValues)
{
if (value.IsOutput)
{
Console.WriteLine(quot;The output parameter {value.Name} has changed its value to: {value.Value}");
}
}
}
static void Main(String[] args)
{
// Initialize the DAL client service layer.
DALService.Initialize();
// Call the BLT component execution method.
SynchronousExecute();
}