COCO - CAPE-OPEN to CAPE-OPEN simulation environment
 Help

Unit operation access functions

The unit operation access functions are implemented in the module COFEUnitOperations. The following functions are currently available:

COFE_GetUnitOperationCount
declared as: Public Function COFE_GetUnitOperationCount()
arguments: [none]
return value: the number of unit operations in the flowsheet
description: Returns the number of unit operations that are present in the flowsheet. The names of the unit operations can be obtained with COFE_GetUnitOperationNames.
example pageaccess unit operation example

COFE_GetUnitOperationNames
declared as: Public Function COFE_GetUnitOperationNames(Optional growArray As Integer = 0)
arguments: growArray: grows the array to the specified amount of elements, leaving blanks for unused elements (optional, see Entering array formulas)
return value: Array with names of the unit operations
description: Returns an array with the names of the unit operations in the document. The unit operation names can be passed to the unit operation access functions described here. Alternatively, the 1-based index into the returned array can be used to identify a unit operation. Unit operation names are not forced to be unique inside COFE; it is up to the user to either make sure the unit operation names are unique or to use unit operation indices.
The returned array is in column format.
example pageaccess unit operations example

COFE_UnitOperationGetParameterCount
declared as: Public Function COFE_UnitOperationGetParameterCount(unitID)
arguments: unitID: name or index of the unit operation
return value: Number of parameters
description: Returns the number of parameters exposed by the specified unit operation
example pageaccess unit operations example

COFE_UnitOperationGetParameterNames
declared as: Public Function COFE_UnitOperationGetParameterNames(unitID, Optional growArray As Integer = 0)
arguments: unitID: name or index of the unit operation
growArray: grows the array to the specified amount of elements, leaving blanks for unused elements (optional)
return value: array of parameter names
description: Returns an array with the names of the parameters exposed by the unit operation. The names of the parameters can be used in the functions to access unit operation parameters.
The returned array is in column format.
example pageaccess unit operations example

COFE_UnitOperationGetParameterValue
declared as: Public Function COFE_UnitOperationGetParameterValue(unitID, parameterID)
arguments: unitID: name or index of the unit operation
parameterID: name or index of a parameter exposed by the unit operation
return value: value of the parameter
description: Returns the value of a parameter exposed by the unit operation. This may be a scalar or array value, depending on the parameter. The parameter dimensionality can be obtained using COFE_UnitOperationFormatParameterDimensionality.
The returned value format depends on the parameter (often scalar, but can be row vector, column vector or matrix).
example pageaccess unit operations example

COFE_UnitOperationFormatParameterDimensionality
declared as: Public Function COFE_UnitOperationFormatParameterDimensionality(unitID, parameterID) As String
arguments: unitID: name or index of the unit operation
parameterID: name or index of a parameter exposed by the unit operation
return value: dimensionality descriptor
description: Returns a string describing the dimensionality (unit of measure) for the specified parameter exposed by the specified unit operation.
example pageaccess unit operations example

COFE_GetUnitPortCount(unitID)
declared as: Public Function COFE_GetUnitPortCount(unitID)
arguments: unitID: name or index of the unit operation
return value: number of ports
description: Returns the number of ports exposed by a unit operation
example pageaccess unit operations example

COFE_UnitOperationGetPortNames
declared as: Public Function COFE_UnitOperationGetPortNames(unitID, Optional growArray As Integer = 0)
arguments: unitID: name or index of the unit operation
growArray: grows the array to the specified amount of elements, leaving blanks for unused elements (optional, see Entering array formulas)
return value: array of port names
description: Returns an array with the names of the ports exposed by the specified unit operations. The port names can be used in functions to access the port properties and connected stream.
The returned array is in column format.
example pageaccess unit operations example

COFE_UnitOperationGetPortType
declared as: Public Function COFE_UnitOperationGetPortType(unitID, portID) As String
arguments: unitID: name or index of the unit operation
portID: name of index of a port exposed by the unit operation
return value: port type
description: Returns the type of the specified port exposed by the specified unit operation:
  • "material": the port is a material port
  • "energy": the port is an energy port
  • "information": the port is an information port
  • "any": the port is of unspecified type
example pageaccess unit operations example

COFE_UnitOperationGetPortDirection
declared as: Public Function COFE_UnitOperationGetPortDirection(unitID, portID) As String
arguments: unitID: name or index of the unit operation
portID: name of index of a port exposed by the unit operation
return value: port direction
description: Returns the direction of the specified port exposed by the specified unit operation:
  • "in": the port is an inlet port
  • "out": the port is an outlet port
  • "in/out": the port is marked as inlet/outlet
example pageaccess unit operations example

COFE_UnitOperationGetPortStreamName
declared as: Public Function COFE_UnitOperationGetPortStreamName(unitID, portID) As String
arguments: unitID: name or index of the unit operation
portID: name of index of a port exposed by the unit operation
return value: name of the stream attached to the port
description: Returns the name of the stream attached to the specified port of the specified unit operation, if any. The returned stream name can be used in stream access functions.
example pageaccess unit operations example

INDEX
CONTENT