Using the Client API
- Last UpdatedMay 09, 2017
- 2 minute read
You can use the Recipe Manager Plus Client API from ArchestrA scripting (Application Object or Managed Graphics) or the Visual Studio environment.
To use the Recipe Manager Plus Client API from ArchestrA IDE
NOTE: You must install the Recipe Manager Plus Server Components and Components for ArchestrA IDE feature on your ArchestrA IDE platform.
-
In the ArchestrA IDE, import the installed RMPClientAPI.dll file from the .RecipeMngrPlus\Bin directory into the Galaxy using the Import\Script Function Library menu option.
To use the Recipe Manager Plus Client API from Visual Studio
-
Open Microsoft Visual Studio 2012. The Visual Studio 2012 Start Page appears.
NOTE: You can use the Recipe Manager Plus Client API in the following versions of Visual Studio 2012, 2013, and 2015.
-
In the Solution Explorer, click Project -> References -> Add Reference. The Add Reference Manager dialog box appears.
-
Click Browse to the locate the RMPClientAPI.dll file.
-
Select the RMPClientAPI.dll file and then click OK. The RMPClientAPI.dll file is ready to use in Visual Studio.
The following is a sample code for RMPClientAPI.dll in C#
// Initialize RMPClientAPI Connection, RecipeAPI and RuntimeParameterAPI
RMPClientAPI.ClientConnection conn = new ClientConnection("RmpHostName", "UserId", "Password");
RMPClientAPI.RuntimeParameterAPI rParamClientApi = new RMPClientAPI.RuntimeParameterAPI(conn);
//Bulk Change target and extension values of all the runtime parameters in equipment tab. Parameters of different datatypes including custom data types
var eParams = rParamClientApi.GetAll("Equipment Name", RuntimeParameterType.EquipmentParameter);
foreach(var equipmentParam in eParams)
{
if (equipmentParam.Name == “Param01”)
{
equipmentParam.Target = "55";
equipmentParam.ExtValues["PE1"] = "ClientRMP";
}
else if (equipmentParam.Name == “Param02”)
{
equipmentParam.Target = "44.5";
equipmentParam.ExtValues["PE3"] = 1; //enumlist datatype extension
}
else if (equipmentParam.Name == “Param03”)
{
equipmentParam.Target = true;
}
}
rParamClientApi.Change(eParams);