The following two functions can be used to retrieve the value of equipment related variables (input/output):
GetEquipVarVal(equipName As String, VarID As VarID, val)
GetEquipVarVal3(equipName As String, VarID As VarID, val, val2, val3)
And the next two functions can be used to set the value of equipment related variables (input):
SetEquipVarVal(equipName As String, VarID As VarID, val)
SetEquipVarVal3(equipName As String, VarID As VarID, val, val2, val3)
The first argument is the equipment name, the second argument (varID) is the variable identifier that specifies the variable we want to access and the third argument (val) is the variables value. The fourth/fifth arguments (val2/val3), also of VARIANT type, are extra identifiers needed for the variable we want to access. The Variable ID that needs to be used for each variable is listed in Equipment Variables. Please, see Accessing Pro-Designer Variables with COM for general information on accessing the Pro-Designer variables with the COM Server.
Finally the following function can be used to retrieve the value of equipment related variables plus a description of the variable and its units if it has any. This function is usually used when enumerating over the variable IDs of the equipment (see Enumerators) and it helps identify the variable being retrieved (input/output):
GetEquipVarValEx(equipName As String, VarID As VarID, val, valName, valUnits)
The first argument is the equipment name, the second the variable ID being accessed, the third the value retrieved, the fourth the name of the variable and the fifth its units name. The final three variables are all of VARIANT type.
For a sample script that illustrates the use of these functions, see Scripts For Equipment Variables.
Functions for Equipment Contents Variables:
The following function can be used to retrieve values of Equipment Contents related variables (ouput):
GetEquipContentsVarVal(equipName As String, VarID As VarID, val, val2, val3, val4)
And the next function can be used to set the value of Equipment Contents related variables (input):
SetEquipContentsVarVal(equipName As String, VarID As VarID, val, val2, val3, val4)
The first argument is the equipment name, the second argument (varID) is the variable identifier that specifies the variable we want to access and the third argument (val) is the variables value. The fourth, fifth and sixth arguments, also of VARIANT type, are extra identifiers needed for the variable we want to access:
val2: The name of an ingredient (Pure Component or Stock Mixture).
val3: The name of the procedure using the equipment.
val4: The name of an operation executed in the procedure or the words "Initial" or "Final".
When using the function GetEquipContentsVarVal it is possible to retreive a value from either the initial state of the equipment, the final state of the equipment or the state after a specific operation of a specific procedure in the equipment. The initial and final states can be specified by passing the words "Initial" or "Final" respectivelly to the argument val4, as well as the procedure name to the argument val3. If you want a variable from the state after the execution of an operation just pass the operation name to argument val4. Finally in order to retrieve a variable regarding an ingredient (component mass flow, component mole fraction, etc) you must also pass the ingredient name to the argument val2. Please note that stock mixture names can only be used when retrieving variables from the initial state of the equipment, meaning you must use the word "Initial" for val4.
The contents of shared equipment that have been dumped before the next procedure uses it, can be found by calling the function GetUPEmptiedContentsVarVal, see Functions for Procedure Variables for information on the arguments needs.
By default the only variables that can be set in the equipment contents is the temperature and the pressure. In order to set any other variable you must first use the function SetEquipContentsAutoInitOtpions to set the initialization option of the equipment contents to SetByUser. This can be done in the following way:
SetEquipContentsAutoInitOtpions "equipName", autoInitMode_VID, byUser_SIM
For more information on the Auto Initialization functions and variables, see Auto Initialization Methods. After you have set the appropriate initialization option, you may use the function SetEquipContentsVarVal to set any variable for the initial contents of the equipment.
The Variable ID that needs to be used for each variable is listed in Equipment Variables. Please, see Accessing Pro-Designer Variables with COM for general information on accessing the Pro-Designer variables with the COM Server.
For sample scripts that illustrate the use of these functions, see Scripts For Equipment Contents Variables