Académique Documents
Professionnel Documents
Culture Documents
Interface Tool
User Guide
Copyright
Release 450
The information in this help file is subject to change over time. Honeywell may make
changes to the requirements described. Future revisions will incorporate changes,
including corrections of typographical errors and technical inaccuracies.
Honeywell
130 Dufferin Ave., Suite 1001
London, Ontario
N6A 5R2
Telephone: (519) 679-6570
Facsimile: (519) 679-3977
Prepared in Canada.
Table of Contents
1 Introduction ......................................................... 1-1
1.1 Overview ........................................................ 1-2
1.2 Components of the UniSim Excel Interface........... 1-3
1
7.3 Using Stream Phases ........................................ 7-3
7.4 Setting Solver Mode ......................................... 7-4
7.5 Setting the environment.................................... 7-4
7.6 Suppressing the pop-up messages...................... 7-5
7.7 Accessing the UniSim Design spreadsheets .......... 7-5
7.8 Setting column specifications ............................. 7-6
7.9 Returning arrays of values................................. 7-7
7.10 Using the UniSim Design Browser ....................... 7-7
7.11 Determining connected streams and operations.... 7-9
7.12 Using the Backdoor variable monikers ............... 7-10
7.13 Reporting extension unit operation variables ...... 7-11
7.14 Reporting property correlations, user variables, and
user properties7-11
7.15 Reporting particle size distribution variables....... 7-12
A Appendix ..............................................................A-1
A.1 UniSim Design Browser Functions Description ...... A-2
2
Introduction 1-1
1 Introduction
1-1
1-2 Overview
1.1 Overview
UniSim Excel Interface Tool is an Excel based tool that works with
UniSim Design. It has two modes of operation:
Excel based case study
A series of in cell custom formulae that can be used to set up
OLE Automation links between UniSim Design and Excel without
the user needing to write any Automation code (these functions
have been incorporated from the legacy UniSim Design Browser
tool)
The tool provides a graphical front end to simplify the set up of the case
study and the writing of these functions.
History
Prior to version R440 the UniSim Design Suite included two functionally
similar Excel Interface tools namely UniSim Excel Interface Tool (USE-
IT) and UniSim Design Browser that helped users to accomplish data
exchange between UniSim Design and Microsoft Excel. In R440 the
functionality of the UniSim Design Browser has been integrated into the
UniSim Excel Interface Tool.
The integrated tool uses the intuitive object browser from the UniSim
Design Browser and provides for the same case study and in cell
custom formulae functions as the earlier versions.
Usage
UniSim Excel Interface R440 has many possible uses, for example:
Material and Energy Balance Tables
Equipment Data Sheets
Case Studies
Optimisation using Excel tools
Communication with other applications through Excel
Simplified model interfaces
What-if Scenarios
1-2
Introduction 1-3
1-3
Getting Started 2-1
2 Getting Started
2-1
2-2 Installing the UniSim Excel
2-2
The Excel Interface Template Workbook 3-1
3-1
3-2 Overview
3.1 Overview
The UniSim Excel Interface Template Workbook is used to configure the
tool and supports both modes of operation: Case Study (legacy UniSim
Excel Interface Tool) and in cell formulae (legacy UniSim Design
Browser)
3-2
The Excel Interface Template Workbook 3-3
Figure 3.1
Enter the UniSim Design case file path and name into cell C3
(either manually or via the UniSim link menu 'Load Simulation'
option)
Set Input Variables (in the Yellow cells) and Output Variables (in
the Blue cells). Variables are configured using the Object
Browser
Define the values of the Input Variables for each case (either by
hand or by getting the current values from UniSim Design)
Run the required cases
3-3
The UniSim Link Menu 4-1
4-1
4-2 Overview
4.1 Overview
Use the UniSim link menu to:
Set the file name & path of the UniSim Design case to work with
in Case Study mode into cell C3 ('Load Simulation')
Run a case study (or read current values into the input or output
cells)('Run Simulation')
Configure case study Input\Output Variables ('Object Browser'
Set 'Options')
Re-Calculate the new- manually- configurable in cell functions
('Re-Calculate')
If this option is selected then Excel will recalculate all the formulae in
the workbook. Depending on the size of the workbook this could take a
considerable time; however this option is recommended when using the
SetAutoUpdate function (see Section 7.1 - Using the Auto Update
option) to ensure that SetAutoUpdate works correctly after the
Workbook is reloaded.
Figure 4.1
The Legacy Object Browser is retained but it can only be accessed when
explicitly turned on via UniSim link menu' Options.
4-2
The UniSim Link Menu 4-3
The section following details both legacy and new Object Browser
features.
While the overall appearance and primary features are the same in both
the modes, there is a slight structural change in the features that are
provided to the user.
The figure below shows the Object Browser opened in 'UniSim Excel
Interface Tool' mode:
Figure 4.2
The data rows in the "Unit Simulation" worksheet are grouped into four
4-3
4-4 Configuring variables using the
regions:
Rows in the
Region Description
worksheet
1 1 to 10 Case configuration cells
2 12 to 24 Input cells
3 26 to 38 Output cells
4 40 onwards The blank cells from which the Browser mode of the
Object Browser starts
Rows 11, 25, and 39 are blank rows that separate the above
regions from one another. The Object Browser, when
launched from these blank cells, opens up in USE-IT mode.
Browser mode
The Object Browser opens up in Browser Mode, when the user tries to
configure OLE automation links in non UniSim Excel Interface Tool (non-
coloured) cells.
The figure below shows the Object Browser opened in 'Browser' mode:
Figure 4.3
4-4
The UniSim Link Menu 4-5
Option Description
Full Path This is the default; it puts the whole case path in the
function in the Excel cell. This makes each cell independent,
but involves a lot of work if the case name or path changes.
Relative Path This option adds a "\" then the file name only in the
function. Internally UniSim Design Browser will look for that
file in the same location as the Excel spreadsheet is saved.
This makes exchanging cases and sheets with colleagues
easier as all the functions will continue to work as long as
the two files are kept in the same location.
Same Name as This option replaces the file name in the function with the
Excel Sheet word "MyName". Internally UniSim Design browser will look
for a UniSim Design case with the same name as the Excel
sheet but with the extension ".usc". This is very useful if
you keep updating the versions of the Excel and UniSim
Design files.
Cell reference This option adds a cell reference in place of the file name.
This is the recommended option as it allows the
functionality of all the above options, whilst allowing the file
names to be kept in one central location.
The Update Cell with Current File Name button can be used to
update the selected cell reference with the current file name.
4-5
4-6 Configuring variables using the
The XML Path contains the XML text about the selected variable, whose
value is being fetched.
When the Export option is chosen, the user can then type a value in
the Variable Value field. This value will instantaneously be exported to
UniSim Design, which will recalculate based on the value.
When this value is changed the new value is written to UniSim Design
immediately. In most cases it makes sense to manually replace the
hard-coded value with a cell reference.
4-6
The UniSim Link Menu 4-7
The OK button will also close the Browser window. The Add button will
keep the browser window open for other functions to be pasted. If Add
is pressed the setting in the After Add group controls how the next
function is placed relative to the first. If the next selected cell contains
a USD Browser function (GetUniSimDesign, GetUniSimDesignArray or
SetUniSimDesign) the browser will read this and populate the UniSim
Design Browser window automatically.
Hide Inapp. Prop (meaning "Hide Black Oil and Electrolyte variables for
streams not using an appropriate fluid package")
If this option is checked then Black Oil and Electrolyte variables will
only be displayed in the Browser for streams using an appropriate fluid
package.
These options are stored in the template workbook (on the hidden
USDBrowserTemplateID_XXX_X sheet) so must be set for each
template to be used.
Select any cell in the row in the case study input (yellow) or output
(blue) cells in which it is desired to add a variable and then choose
'Object Browser' from the UniSim link menu. The Object Browser shows
all the objects in the selected case, organised into a tree structure by
flowsheet and object type. For each object a list of available properties
4-7
4-8 Configuring variables using the
is displayed.
Figure 4.4
UniSim Excel Interface tool uses XML to record the variables it will read
and write. This XML is stored in column A. By ticking the 'Use
Description' checkbox a more descriptive variable name will be written
in column B. Units are written in column C and may be modified by the
user.
Also while configuring phase variables, the user has to follow certain
4-8
The UniSim Link Menu 4-9
Figure 4.5
Select the cases to run in the list box (Use 'Shift' or 'Ctrl' to select
multiple cases if required).
The action taken on the selected cases when 'Run UniSim Design' is
4-9
4-10 Configuration options
Option Description
Run Run the case study for each of the selected cases (i.e. Set
Inputs, Solve UniSim Design, Get Outputs)
Set Inputs Set the Inputs for the selected case(s), but don't solve
UniSim Design
Debug While running the UniSim Excel Interface calculation
period, if user wants to interrupt UniSim Simulation case
solving, in case of more than one specifiable property, user
can choose 'Debug' mode.
A message box "Do you want to proceed with debugging?"
will be prompted with Yes and No buttons. Pressing 'Yes'
will specify the appropriate input to the simulation case and
start the solver. Pressing 'No' will simply specify the
appropriate input and will not start the solver.
Get Inputs Get the current value for each of the Inputs.
Get Outputs Get the current value for each of the Outputs.
Hover the mouse over each option to see a description of that option.
The settings for the options are saved in a hidden sheet in the Template
Workbook, so different Template Workbooks can have different values
for the settings.
4-10
The UniSim Link Menu 4-11
Run options
Figure 4.6
Option Description
Run UniSim in UniSim Design flowsheet simulation case will be visible
Visible Mode while the case is running. This option depends on the
'UniSim Design Leave Open' option setting. Only when
'UniSim Design Leave Open' is checked on does 'Run
UniSim Visible Mode' take effect.
UniSim Design If checked UniSim Design application window will be left
Leave Open open once executions are done.
Run Oil Manager If checked UniSim Design will Enter and Leave the Oil
Environment before each case is run. Should be used when
Oil Environment settings are changed in the UniSim Excel
Interface Tool case study.
Force Download Force re-load of UniSim Design file before each case is run.
Each time the case is loaded a new instance of UniSim
Design is started.
Disable PreCalc
Macro
Disable PostCalc
Macro
4-11
4-12 Configuration options
Macro Description
Case Iterations Allows the user to run each case multiple times in
succession, before moving on to the next.
Can be used with the Pre/PostCalc Macro to enable custom
functionality.
Dynamics Mode Allows the user to run dynamics models without stopping
the solver during specification changes.
Minimize USD Allows the user to instruct UniSim Design to send pop-up
PopUps messages during model execution to its trace window
preventing the need for user interaction with the pop-ups.
4-12
The UniSim Link Menu 4-13
Browser options
Figure 4.7
Option Description
Auto Description Automatically use UniSim Object /
Property name in description
(Column B)
Excel Auto Move Down Cannot be disabled. Move the Excel
selection down to the next row after
a variable has been added. If less
than three rows are left blank in the
Inputs / Outputs section below the
cell where the variable is added,
UniSim Excel Interface will add
additional rows.
UniSim SS Auto Move Down After a UniSim spreadsheet cell
property is added as a variable
automatically increment the row
selection in the Browser to select the
row underneath.
Allow UniSim SS Overrun Allow Linking to cells beyond UniSim
Spreadsheet limits.
Check Input Specifiable When an input variable is added to
the spreadsheet using the Browser
check whether it is currently
specifiable and if it is not display a
warning message to the user. If this
option is disabled then the user will
not be warned when adding a
calculated variable as an input. At
run time UniSim Excel Interface tool
will always give an error when
attempting to specify a variable
which is calculated in UniSim Design.
4-13
4-14 Configuration options
Option Description
Hide XML Path Hide XML object path display in
Object Browser and expand UniSim
object tree view to fill the whole
window.
Object/Property Sorted If ticked Object and Property items
are sorted alphabetically (A to Z)
when displayed in the Object
Browser. If unticked Objects are
displayed in the order they were
added to the case and properties
with most commonly used first.
Hide Calculated in Input When active cell is in input range,
calculated variables are hidden in the
property selection box in the Object
Browser.
Analyze Specifiable Check which properties are
calculated or specifiable and colour
code the Object Browser property
selection box accordingly (black =
calculated, blue = specifiable).
Other options
Figure 4.8
Option Description
Use Only Browser Mode The effect of ticking this is that the USE-IT's
'Unit Simulation' sheet is hidden so the user
may then only work in 'Browser Mode'
Show XML Data Link in Column A Show or Hide the XML string in the Column A
of the UniSim Excel Interface 'Unit
Simulation' worksheet.
Show Error in Dialog Show any error messages within a dialog box
4-14
The UniSim Link Menu 4-15
Option Description
Write Error In Log File Write any error messages to a log file
(eSimErrorLog.txt) in the same folder where
the UniSim Excel Interface template file is_
stored.
If the UniSim Excel Interface template has
not yet been saved as a specific xls file then
the error log file will be written in the root
directory (e.g. C:\ or D:\)
If UniSim Excel Interface tool cannot write the
error log file for any reason an error message
is displayed.
Pause between Calculation Require user confirmation to proceed between
Period calculation periods if multiple calculation
periods are chosen.
A message box "Do you want to proceed
running calculation trial 2?", will be prompted
for user input.
Use Old 'Object Browser' This check box, when checked, enables the
user to work with Object Browser interface
from the R430 version of USE-IT. See
Section 4.2.9 - Legacy object browser for
more details.
Enable Double Click To Open This Check box when checked enables user to
Object Browser open Object Browser upon double- click on
any of the active cells. Based on the active
cell type (colored/non-colored) the Object
Browser either opens in UniSim Excel
Interface Tool Mode (if the active cell is a
colored cell) or in Browser Mode (if the active
cell is non-colored cell).
4-15
Typical Usage 5-1
5 Typical Usage
5-1
5-2 UniSim Excel Interface Tool mode
New UniSim Excel Interface, starting from version R440 supports two
modes of operation, namely
UniSim Excel Interface Tool Mode
Browser Mode
In both the modes, the objective is to set up OLE links between UniSim
Design and Excel.
5-2
Typical Usage 5-3
5-3
5-4 Browser Mode
Example:
Figure 5.1
Examine the formula that has been created on the spreadsheet. In the
example above this looks like:
=GetUniSimDesign("C:\Program Files\Honeywell\UniSim Design
R440\Samples\dyntut1.usc","Main","Feed
1","Stream","MolarFlow","kgmole/s","")
Here the case file name, flowsheet, object name, object type, variable
and unit for the selected variable are being passed as parameters to the
GetUniSimDesign custom function. This formula can be manipulated
just like a normal Excel formula. For example by inserting references to
other cells instead of directly specifying values, or by copy/pasting the
formula between cells.
If a value is being imported from UniSim Design and the value within
UniSim Design changes then the UniSim Design Browser functions do
not (by default) update automatically. Select the cells to update and
press the Re-Calculate Selected USD Browser Cells from the toolbar
menu to force an update.
Values being exported from Excel to UniSim Design are always updated
as soon as they are changed.
5-4
The UniSim Design Browser Excel Functions 6-1
6.5 SetAutoUpdate............................................................................... 4
6.6 GetSpreadSheet............................................................................. 5
6-1
6-2 Overview
6.1 Overview
The UniSim Design Browser templates provide a set of custom Excel
spreadsheet functions to allow data to be extracted from and set into
UniSim Design. Some of these are accessible from the UniSim Design
Browser window discussed above; others must be directly entered into
the spreadsheet. All can be manually edited, if required, just like any
other Excel spreadsheet function. The functions are described briefly in
this section and in more detail in Section 7 - Advanced Functions for
Excel In-cell Formulae.
6.2 GetUniSimDesign
(Available directly from the Browser) The GetUniSimDesign function is
used to import a value for a certain variable from a UniSim Design case
into an Excel spreadsheet (or VBA application). The syntax for this
function is:
GetUniSimDesign (CaseFileName, EnvOrFSName, ObjectName,
ObjectType, VariableName, Units, ItemIndex, Update [Optional],
SolverMode [Optional], Environment [Optional], SuppressPopUps
[Optional], ExtraIndex [Optional])
where:
6-2
The UniSim Design Browser Excel Functions 6-
6.3 GetUniSimDesignArray
(Available directly from the UniSim Design Browser, when an array
variable is chosen (e.g. ComponentNames or any Component fraction)
and the [All - Array V] or [All - Array H] options are chosen ).
where:
6-3
6-4 SetUniSimDesign
6.4 SetUniSimDesign
(Available directly from the Browser):
6.5 SetAutoUpdate
(Not available from the Browser Interface, can be used by manually
typing the function name in a cell)
This function sets a specific cell to be changed every time the UniSim
Design case re-solves. This change is then used to trigger any cell
referencing the UpdateCell to re-calculate. The syntax for this function
is:
SetAutoUpdate(CaseFileName, UpdateCell)
6-4
The UniSim Design Browser Excel Functions 6-
where:
6.6 GetSpreadSheet
(Not available from the Browser Interface, can be used by manually
typing the function name in a cell)
where:
6.7 SetSpreadSheet
(Not available from the Browser Interface, can be used by manually
6-5
6-6 GetSpreadSheetValue
6.8 GetSpreadSheetValue
(Not available from the Browser Interface, can be used by manually
typing the function name in a cell):
6.9 SetSpreadSheetValue
(Not available from the Browser Interface, can be used by manually
typing the function name in a cell):
6-6
Advanced Functions for Excel In-cell Formulae 7-1
7-1
7-2 Using the Auto Update option
The SetAutoUpdate function should only be used once per Excel file,
Users should exercise caution when using this option, since it will force
more traffic between Excel and UniSim Design, and might cause one of
7-2
Advanced Functions for Excel In-cell Formulae
Example
Cell A1 =False
Cell B1 =1 (stream name)
Cell A2 =GetUniSimDesign("Z:\G-3.usc", "Main", B1, "Stream",
"Temperature", "C", "", A1)
Cell A2 will not update even if the value of cell B1 (stream name)
was changed.
After importing a value for a stream, go to the cell where the function
was inserted and replace the word Stream in the function's ObjectType
parameter with any of the following:
Vapour to get the vapour phase
Liquid to get the light liquid phase
HeavyLiquid to get the heavy liquid phase
CombinedLiquid to get the combined liquid phase
Example:
=GetUniSimDesign("Z:\G-3.usc", "Main", "1", "Vapour",
"Temperature", "C", "")
7-3
7-4 Setting Solver Mode
Example:
=GetUniSimDesign ("Z:\G-3.usc", "Main", "1", "Stream",
"Temperature", "C", "", , "Hold")
Example:
=GetUniSimDesign("Z:\G-
3.usc","Main","1","Stream","Temperature","C","", , ,"Basis")
7-4
Advanced Functions for Excel In-cell Formulae
Example:
=GetUniSimDesign("Z:\G-
3.usc","Main","1","Stream","Temperature","C","", , ,"Basis")
=GetUniSimDesign("Z:\G-3.usc","Main","1","Stream"," Temperature
","C","", , , ,"SuppressAll")
For example this call sets the value of the temperature variable
imported from a stream into cell B1, of the named spreadsheet on the
main flowsheet of the current case.
=SetUniSimDesign ("","Main","SPRDSHT-
1","Operation","Variable","F","B1",5)
This call returns the currently displayed value in cell A2 of the same
spreadsheet:
7-5
7-6 Setting column specifications
=GetUniSimDesign("","Main","SPRDSHT-
1","Operation","CellValue","","A2")
Option Description
Goal To get or set the desired value for the specification
Current To get the current calculated value for the spec
IsActive To check if the spec is activated (with GetUniSimDesign) or
activate/deactivate it (with SetUniSimDesign)
IsUsedAsEstimat Corresponds to the Estimate checkbox for the spec
e
AbsoluteToleran To get or set the absolute tolerance
ce
WeightedToleran To get or set the weighted tolerance
ce
Error To get the weighted error
All the properties returning numeric values (all except IsActive and
IsUsedAsEstimate) should be supplied with a unit, these properties also
have companion properties named the same except with Value
appended (e.g. GoalValue) which accesses the variable in UniSim
Design internal units.
For example the function below retrieves the current value of the
"Kero_SS Prod Flow" spec from the column in the R-1.usc sample case:
=GetUniSimDesign("C:\Program Files\Honeywell\UniSim Design
R400\Samples\R-1.usc","Main","T-100","Operation","Current","m3/
h","Kero_SS Prod Flow")
This function sets a new goal value in another spec on the column:
=SetUniSimDesign("C:\Program Files\Honeywell\UniSim Design
R400\Samples\R-1.usc","Main","T-100","Operation","Goal","kJ/
h","Kero Reb Duty", 7950000)
7-6
Advanced Functions for Excel In-cell Formulae
cells selected in Excel is larger than the array returned by the function
then the extra cells show "#N/A". If the array of cells selected in Excel
is smaller than the array returned then the last values are truncated.
The VorH parameter sets whether the array returned is vertical (by
rows) or horizontal (by columns).
For example the function below retrieves the component names from
stream "1" on the main flowsheet of the G-3.usc sample case.
=GetUniSimDesignArray("C:\Program Files\Honeywell\UniSim Design
R400\Samples\G-
3.usc","Main","1","Stream","ComponentNames","","Nitrogen","n-
Decane","v")
When specifying the limits for the values that are returned (via
StartItemIndex and EndItemIndex) it is possible to pass either the
component name, the position (0 is the first in the list, 1 the second
etc) or an empty string "". For StartItemIndex an empty string is
taken as the first entry and for EndItemIndex the last entry.
7-7
7-8 Using the UniSim Design Browser
{0.5,0.2,0.1,0.1}
Consider a case with a tee on the main flowsheet with three product
stream connections. The first two split fractions are specified and the
tee calculates the other (1- sum of first two fractions). The following
functions could be used to set the first two split fractions
=SetUniSimDesign("E:\anycase.usc","Main","TEE-
100","Operation","Splits","","0",0.2)
=SetUniSimDesign("E:\anycase.usc","Main","TEE-
100","Operation","Splits","","1",0.3)
UniSim Design would then calculate the third split as 1 - 0.2 - 0.3 = 0.5
Alternatively both split fractions could be set at the same time using a
function like:
=SetUniSimDesign("E:\anycase.usc","Main","TEE-
7-8
Advanced Functions for Excel In-cell Formulae
100","Operation","Splits","","0",{0.2,0.3})
When setting the values the Browser checks to see if any of the entries
in the array were read only. Depending on the situation the result of the
formula (that is displayed in the cell) could be one of the following
values:
7-9
7-10 Using the Backdoor variable
where:
Examples
To return the tag of the flowsheet containing a stream (in this situation
the result would be same whatever the object specified within the
flowsheet):
=GetUniSimDesign("","Main","1","Stream","Backdoor[<flowsheet>:N
ame]","","")
To return the file name of the case (in this situation the result would be
same whatever the object specified):
=GetUniSimDesign("","Main","1","Stream","Backdoor[<case>:FullFi
7-10
Advanced Functions for Excel In-cell Formulae
leName.100]","","")
To return the full version of UniSim Design (in this situation the result
would be same whatever the object specified):
=GetUniSimDesign("","Main","1","Stream","Backdoor[<application>
/:VersionString.200]","","")
where:
For example to retrieve the wet bulb temperature from the Saturate
example extension enter:
=GetUniSimDesign("Z:\G-2.usc","Main","Saturate
Stream","Operation","ExtensionVar[WetBulb]","C","")
7-11
7-12 Reporting particle size distribution
where:
For example:
=GetUniSimDesign(A1,"Main","1","Stream","Correlation[Standard\M
olecular Weight]","","")
where:
User Variable Tag - (note this is not necessarily the same as the
name) can be found on the user variable code editing window.
For example for a user variable with tag mymasscalc that has units of
mass.
=GetUniSimDesign(A1,"Main","1","Stream","UserVar[mymasscalc]","
lb","")
For example:
=GetUniSimDesign(A1,"Main","IN","Stream","UserProp[UserProp-
1]","","")
Which in this case reports the solid component name at position 2. (For
example "Sand*")
7-12
Advanced Functions for Excel In-cell Formulae
In this case the value "10" for the parameter ItemIndex indicates the
10th position within the (zero-based) array of PSD values.
7-13
Managing the Excel Add-ins 8-1
Figure 8.1
8-1
Frequently Asked Questions (FAQs) 9-1
9 Frequently Asked
Questions (FAQs)
1. What do I do to use old UniSim Design- Browser Spread
Sheets with this new UniSim Excel Interface R440?
Copy the whole spreadsheet (say "Sheet 1") on to the new UniSim
Excel Interface tool's work book.
Select all Spreadsheet cells.
Press the Re-Calculate button from the UniSim link menu bar.
2. Does this new UniSim Excel Interface R440 affects while
working with old UniSim Excel Interface Tool cases
(spreadsheets)?
No, it doesn't affect.
Since manual functions are associated with USE-IT10_Template.xlt
file, those will not be available when user migrates from old UniSim
Excel Interface Tool cases.
3. Working with higher versions of Excel -2010 sometime
produces error like as shown in below screen?
9-1
Frequently Asked Questions (FAQs) 9-2
From version R450 the UniSim Excel Interface tool also supports the 64
bit version of Microsoft Excel but the correct version must be installed.
This install is a regular UniSim Excel Interface Tools installer that takes
care of installing x86 (32-bit) version of UniSim Excel Interface on 32
and /or 64-bit operating system with strictly x86 (32-bit) version of
Microsoft Excel (for instance Excel-2007 and 32-bit version of Excel-
2010, 2013 and 2016).
Note: This installer should not be used in conjunction with x64 (64-bit)
version of Microsoft Excel (for instance 64-bit version of Excel-2010,
2013 and 2016).
9-2
Frequently Asked Questions (FAQs) 9-3
This install is a new UniSim Excel Interface Tools installer that takes
care of installing x64 (64-bit) version of UniSim Excel Interface on only
64-bit Operating Systems (OSs) with strictly x64 (64-bit) version of
Microsoft Excel (for instance 64-bit version of Excel-2010, 2013 and
2016).
Note: This installer should not be used in conjunction with x86 (32-bit)
version of Microsoft Excel (for instance Excel-2007 and 32-bit version of
Excel-2010, 2013 and 2016).
9-3
Appendix A-1
A Appendix
A-1
A-2 UniSim Design Browser Functions
A.1.1 CaseFileName
The CaseFileName parameter is used to pass the name of the case to
be accessed. There are five options for setting this parameter:
1. Full Name (including path)
for example "C:\Program Files\Honeywell\UniSim Design
R400\Samples\G-2.usc"
2. Relative Path
for example "\G-2.usc" or "\Samples\G-2.usc"
The preceding "\" indicates that the specified path is relative to the
owner Excel sheet. Note that this file location is dependant on the
file location of the Excel file, it has to be saved before relative path
is used.
3. The same name as the owner Excel file
This is particularly useful if you keep renaming your case and don't
want to keep changing the references in the Excel. This is set by
entering the word "MyName" in the CaseFileName parameter.
4. Empty quotes (use Active case)
A.1.2 CellAddress
The CellAddress parameter is used by the Spreadsheet access functions
(GetSpreadsheet, Set Spreadsheet, etc...). It is used to pass the
address of the cell to be accessed, for example "A1", "B6", etc...
A-2
Appendix A-3
A.1.3 EnvOrFSName
If accessing objects within the Oil Characterisation environment Oil
Manager is passed for the EnvOrFSName parameter, otherwise this is
used to pass the Tag of the flowsheet to be accessed. In UniSim Design
each flowsheet within a case must have a unique flowsheet Tag. It is
this Tag that must be passed to this parameter. The flowsheet Tag can
be found by looking on the Connections tab of the Sub-Flowsheet
window or by looking in the title bar of the PFD for the flowsheet.
Figure A.1
A.1.4 ItemIndex
The ItemIndex parameter is used to identify a specific item within an
A-3
A-4 UniSim Design Browser Functions
A.1.5 StartItemIndex
The StartItemIndex parameter is used to identify the first item in the
array that will be returned. As for the ItemIndex parameter either a
number or a name can be supplied. If an empty string is supplied the
first item is assumed.
A.1.6 EndItemIndex
The EndItemIndex parameter is used to identify the last item in the
array that will be returned. As for the ItemIndex parameter either a
number or a name can be supplied. If an empty string is supplied the
last item is assumed.
A-4
Appendix A-5
A.1.7 NewValue
The NewValue parameter is used to pass the new value to be exported
to UniSim Design. The type of value you pass is a function of the
variable specified, for example "Temperature" would require a
numerical value, while "Name" would require a string.
Arrays are supported when passing new values, so if you are passing
composition through an Excel spreadsheet the following formats can be
used in your function for the NewValue parameter:
...,B1:B16,...
...,{0.05,0.04,0.84,0.36},...
[Note these are curly brackets {} not round brackets
()]
When passing arrays, the ItemIndex parameter is used to specify
the first entry in the UniSim Design array that will be modified. For
example if an array containing two values is passed to a UniSim
Design composition with an ItemIndex of 3 then the compositions
at positions 3 and 4 in UniSim Design will be updated. Remember
UniSim Design arrays number from 0.
A.1.8 ObjectName
The ObjectName parameter is used to pass the name of the object to
be accessed. Currently only Streams and Unit Operations are
supported.
A.1.9 ObjectType
The ObjectType parameter is used to pass the object type to be
accessed. In a UniSim Design flowsheet the names of all the streams
must be unique and similarly the names of all the unit operations must
be unique, but it is possible to have a stream named the same as a unit
operation; hence the need to differentiate. Also it is possible to make
UniSim Design Browser access stream phase properties by supplying a
A-5
A-6 UniSim Design Browser Functions
A.1.10 SolverMode
This is an optional parameter. All the functions are set up to default to
NoAction if no value is supplied.
The SolverMode parameter sets the solver mode of the case. The
options for this entry are:
Active - Activates the solver
Hold - Puts the solver on hold
Toggle - Switch it from its current state to the other
NoAction - Just leave it as it is (default)
Setting the solver mode to hold while you make a number of changes
can save time, since UniSim Design will not re-converge after every
change.
A.1.11 Environment
This is also an optional parameter. All the functions are set up to
default to NoChange if no value is supplied.
A.1.12 SuppressPopUps
This is also an optional parameter. All the functions are set up to
default to NoSuppress if no value is supplied.
A-6
Appendix A-7
A.1.13 ExtraIndex
This parameter is currently used only to set the Name (or index) of the
solid component for PSD properties, and is required only when
reporting Particle Size Distribution (PSD) Properties.
A.1.14 SpreadsheetName
This parameter passes the name of the Spreadsheet to be accessed.
A.1.15 Units
This parameter passes the units for the value to be set or returned. If
no units are specified (empty quotes), UniSim Design internal units will
be used.
A.1.16 Update
The Update parameter is mainly used as a trigger for re-evaluating the
function. It can also be used to prevent uncontrolled updates by
setting its value to "False".
A-7
A-8 UniSim Design Browser Functions
A.1.17 UpdateCell
The UpdateCell parameter accepts only a cell reference as a value and
is used by the SetAutoUpdate function to set a cell (other than the one
holding the function) to be an AutoUpdate cell. The referenced cell
value will be controlled by the UniSim Design Browser and will be
updated with a randomly generated number every time the UniSim
Design case re-calculates.
That cell can then be used as an Update cell in other UniSim Design
Browser functions to create a live link between UniSim Design and
Excel.
A.1.18 VariableName
This is used to supply the name of the variable to be accessed. The
best way to get the value for this parameter is to create a function
using the UniSim Design Browser graphical interface which
automatically sets the value.
The UniSim Design Browser uses the variable names as defined in the
UniSim Design object library. This can be accessed in the Excel VBA
editor (Tools - Macro - Visual Basic Editor menu option) by using
the view Object Browser menu option.
A-8
Appendix A-9
Backdoor[Moniker]
A.1.19 VorH
This is an optional parameter for the GetUniSimDesignArray function.
If no value is supplied then v is assumed. This parameter sets the
orientation of the array returned. If v (or nothing) is supplied then
the array returned is vertically arranged, if any other value is supplied
then the array returned is horizontal.
A-9