ChemCAD 5 services to visual basic applications: User Manual, страница 6

Method             GetNoOfInlet

Returns                        count of inlets

Method             GetInletIDs

Returns                        count of inlet IDs returned in array inletIDs

Argument

Type

Description

inletIDs

short[]

Integer array containing inlet IDs [out]

The following two methods give the count and the IDs of outlets. The ID array need to be defined in VBA macro before calling GetOutletIDs with lower bound at one and upper bound at no less than the outlet count.

Method             GetNoOfOutlets

Returns                        count of outlets

Method             GetOutletIDs(VARIANT outletIDs)

Returns                        count of outlet IDs returned in array outletIDs

Argument

Type

Description

outletIDs

short[]

Integer array containing outlet IDs [out]

The next group of methods gives the ID of current Excel Unit, current loop count and the maximum number of runs respectively.

Method             GetCurUnitOpID

Returns                        ID of the current Excel Unit

Method             GetLoopCount

Returns                        current loop number

Method             GetLoopLimit

Returns                        maximum number of runs

If the current unit is kinetic reactor (KREA) or batch reactor (BREA) and user specifies rate expressions, user may retrieve liquid (include solid) and vapor phase from the following functions.

Method             GetReactorLiquidPhase / GetReactorVaporPhase

Returns                        count of data items returns

Argument

Type

Description

compLbmol

float[]

Float array containing liquid or vapor amount

A significant run time variable RerunFlag allow user to control flowsheeting simulations from Excel macros. Setting the flag to be one forces CHEMCAD 5 to repeat the simulations even the flowsheet has converged. User can stop repeated simulations by resetting the flag to zero.

Method             GetRerunFlowsheetFlag / SetRerunFlowsheetFlag

Returns                        current value of RerunFlag

Description      IFlowsheet provides methods for querying the connections of streams and unit operations on the current flowsheet. For a given stream, the source and target unit can be determined. If a unit ID is known, the inlets and outlets of the unit can be queried. All feed streams or product streams can be identified.

Definition        dispinterface IFlowsheet

{      

methods:

short GetNoOfStreams();

short GetNoOfUnitOps();

short GetAllStreamIDs(VARIANT idArray);

short GetAllUnitOpIDs(VARIANT idArray);

short GetStreamCountsToUnitOp(short unitOpID, short* nInlets, short* nOutlets);

short GetStreamIDsToUnitOp(short unitOpID, VARIANT idArray);

short GetInletStreamIDsToUnitOp(short unitOpID, VARIANT idInlets);

short GetOutletStreamIDsToUnitOp(short unitOpID, VARIANT idOutlets);

short GetSourceAndTargetForStream(short streamID, short* sourceID, short* targetID);

short GetNoOfFeedStreams();

short GetNoOfProductStreams();

short GetFeedStreamIDs(VARIANT idArray);

short GetProductStreamIDs(VARIANT idArray);

};

Methods          Stream IDs can be retrieved for the entire flowsheet, streams around a unit, feed stream only or product stream only using

Method             GetNoOfStreams

Returns                        count of all streams on the current flowsheet

Method             GetAllStreamIDs

Returns                        count of stream IDs returned in idArray

Argument

Type

Description

idArray

short[]

Integer array containing all stream IDs [out]

Method             GetStreamCountsToUnitOp

Returns                        total number of streams connected to the given unit

Argument

Type

Description

unitOpID

nInlets

nOutlets

short

short

short

ID of a unit on the flowsheet [in]

count of inlets to the unit [out]

count of outlets to the unit [out]