Specifications
Customization FAQ A-11
A-11
d. Click the Start icon on the Visual Basic toolbar. The
Debug property view appears.
e. Load a HYSYS simulation case and install the extension
by, pressing F12 (to open the UnitOps property view) and
double-clicking on name of the extension in the Available
Unit Operations list.
f. Select extension attachments and parameters as
appropriate to make the extension calculate. When Visual
Basic reaches the breakpoint in the extension, it will move
in front of HYSYS. The code will be paused at the
breakpoint. You can step through the code line-by-line
interactively while the extension is running. Use the F8
key to step through the code line-by-line and F5 to stop
stepping through the code and run the remainder non-
interactively. While stepping through the code you can
interactively view and set values in the Debug property
view.
For example, typing ?StreamName.TemperatureValue
and pressing ENTER will return the temperature of the
stream named StreamName in HYSYS internal units (°C).
3. How do I reference streams and variables in the EDF?
Ans: Use the FindVariable method of the Container object.
For example, the following code makes an object reference
to the stream object with the Tag name “Feed” in the EDF.
The following code makes an object reference to the real
value object with the tag name “PrdTmp” in the EDF.
HYSYS calls the extension three times (one Forgetting pass
and two Execute passes). HYSYS is inactive while the
extension is being stepped through.
Set hyFeed = hyContainer.FindVariable("Feed").Variable.Object
Set hyProdTemp = hyContainer.FindVariable("PrdTmp").Variable
Start icon