You are on page 1of 4

Equilibrium Plots Unit Operation Extension:

Version 2.3
This extension will plot binary XY, TXY, PXY diagrams as well as Ternary VLE and
LLE diagrams. The plots can also be viewed in tabular format which can be expo
rted to a text file.
This Automation application has been created by Hyprotech Technical Support as a
n example of what can be achieved through the object architecture of HYSYS. The
application is provided for academic purposes only and as such is not part of H
yprotechs QA procedures. We strongly encourage users of this facility to check r
esults carefully and use the facility accordingly. Please report any problems e
ncountered through the normal support channel at support@hyprotech.com.
Extension registration and troubleshooting tips
Some extensions off the Hyprotech Website will include a setup.exe file. Runnin
g this program
will automatically register the .dll and install any Microsoft .dll files that a
re required to
run it. If there is no setup.exe then the extension .dll will have to be regist
ered by the user
following the directions below.
These troubleshooting tips are written assuming that the proper MSVBVM .dll file
is loaded on the
users computer in the system32 directory. Some extensions use MSVBVM50.dll and
some use
MSVBVM60.dll. Both should be downloaded off the website unless there are versio
ns already
loaded on the users computer. Do a file search before downloading them and if y
ou have a
later version of the .dll's than the ones on the Hyprotech site, you might not w
ant to
overwrite them.
The extensions were only tested in Windows NT and Windows 2000, Excel 97 and Exc
el 2000. This
does not preclude them form working in other versions however.
1.) How do I register an extension I download from the web site?
Ans: There are several ways to do this once the files are dowloaded on to your c
omputer and unzipped.
In HYSYS
Go to Tools Preferences Extensions tab. Press the Register Extension bu
tton. Browse to
find the file folder where you have saved the downloaded extension. Cho
ose the .dll file
and press OK. A message will come up saying that the file was successfu
lly registered.
In Windows Explorer
Find the folder where you have downloaded and unzipped the extension. C
hoose the .dll
file and physically drag it with your mouse over the regextn.exe file th
at is included
in the HYSYS root directory (same directory as HYSYS.exe). You should g
et a message
that the registration was successful.
In MS DOS
a.) Register the extension definition file (EDF) which allows the extensio
n to be run
interactively using Visual Basic
b.) Register the compiled extension dynamic link library (DLL) file which
integrates the
extension into HYSYS.
Whether registering the EDF or DLL file, the procedure is the same:
1.) Open a DOS windows and type the following:
C:\HYSYS\ExtSDK\RegExtn.exe [Path][FileName].xxx
Where, [Path] is the path to the extension file
[FileName] is the name of the extension file,
xxx is the EDF or DLL extension
NOTE: This assumes that HYSYS located is in the C:\HYSYS directory and tha
t the HYSYS
Extension SDK is installed.
2.) What happens if the registration is not successful?
This error should not come up for any of the extensions you download off
the website.
Check that the regextn.exe file is in your HYSYS root directory and chec
k that
all files were downloaded and unzipped properly, if you still get this e
rror contact
Hyprotech technical support.
3.) How do I add an extension operation to my HYSYS simulation?
Go to Flowsheet Add Operation in HYSYS. A window will come up. Press t
he radio
button for Extension operations. Your extension should be there. Highl
ight it
and press Ok.
4.) I've registered my extension but I don't see it in the Extension Operations
list under
Flowsheet Add Operation.
Sometimes HYSYS needs to be refreshed. You might have to close the prog
ram and open it up
again. You shouldn't need to re-boot your computer. Check in Preferenc
es Extensions and
ensure that the .dll is in the directory your Preferences are pointing t
o.
5.) My case from an older build of HYSYS contains extensions and when I open it
in a new
version of HYSYS I get load errors.
HYSYS will re-register your extensions automatically when you move from
a lower to
higher build. If you remove the old HYSYS program before installing the
new
version then you'll probably have to re-register all extensions.
6.) I've thought of everything and I still get load errors.
Check that the MSVBVM60.dll and MSVBVM50.dll files are in the Windows sy
stem32 directory.
Check that the .dll is in the same location as the location in Preferenc
es Extensions.
Check that the .dll is not on a network directory that you cannot access
(due to
permissions or your network is down etc.)
Check that the extension does not require a bit to be set on your HYSYS
key. For
example, the TASC and Pipesys extensions require a proper license for th
em to run.
Other things to try:
Move the .dll to the "C:" drive and re-register it.
Register the .dll from MS-DOS using procedure 1 c.)
For users who are writing their own extensions for HYSYS:
7.) What is the difference between registering the EDF instead of the DLL?
Ans: Registering the EDF allows you to interactively run and debug the extension
using Visual
Basic. However, a warning message will be displayed since no DLL was regis
tered.
If you want to interactively run and debug the reaction extension, use the
following
sequence:
a.) Register the EDF file. This will display a warning message which you
can ignore.
b.) Press the Run button in Visual Basic. This will bring up the debug wi
ndow.
c.) Load HYSYS and add a reaction. If everything is working properly, you
r reaction
extension will appear in the list. During this time, you can switch t
o Visual Basic
and add breakpoints to check variable values, debug, etc.
Once you are complete with debugging and want the reaction extension to be a
vailable, use
the following sequence:
a.) Compile the reaction extension into a DLL.
b.) Register the DLL file.
c.) Load HYSYS and add a reaction. If everything is working properly, you
r reaction
extension will appear in the list.
8.) How can I interactively run an extension?
Ans: Use the following procedure:
1.) Register the extension definition file (EDF). See #4 above.
2.) Load the extension Visual Basic project (VBP) file, select Project fro
m the View menu
and double-click on the class module (the file will have the .cls suff
ix).
3.) Right-click on an appropriate line of code and select Toggle Breakpoin
t. The line will
turn red, indicating a breakpoint at which the execution of the code w
ill be paused.
4.) Press the Start button on the Visual Basic toolbar. The Debug window
will appear.
5.) Load a HYSYS simulation case and install the extension by pressing F12
and double-
clicking on name of the extension in the unit operation list-box.
6.) 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 s
tep through the
code line-by-line interactively while the extension is running. Use t
he 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 val
ues in the Debug
window. For example, typing ?StreamName.TemperatureValue and pressing
enter will
return the temperature of the stream named StreamName in HYSYS interna
l units (C).
NOTE: HYSYS will call the extension three times (one Forgetting pass
and two Execute
passes). HYSYS will be inactive while the extension is being stepped
through. See #2
and #3 above.

You might also like