Professional Documents
Culture Documents
PRO II Com Server Reference Guide PDF
PRO II Com Server Reference Guide PDF
PRO II Com Server Reference Guide PDF
REFERENCE GUIDE
PRO/II COM Server The software described in this guide is furnished under a written agreement
Reference Guide 8.0 and may be used only in accordance with the terms and conditions of the
license agreement under which you obtained it. The technical
documentation is being delivered to you AS IS and Invensys Systems, Inc.
makes no warranty as to its accuracy or use. Any use of the technical
documentation or the information contained therein is at the risk of the user.
Documentation may include technical or other inaccuracies or typographical
errors. Invensys Systems, Inc. reserves the right to make changes without
prior notice.
Copyright Notice Copyright Notice © 2006 Invensys Systems, Inc. All rights reserved. No
part of the material protected by this copyright may be reproduced or utilized
in any form or by any means, electronic or mechanical, including
photocopying, recording, broadcasting, or by any information storage and
retrieval system, without permission in writing from Invensys Systems, Inc.
Server Object------------------------------------------------------- 9
Overview -----------------------------------------------------------------------------9
General Server and File Manipulation Methods ----------------------------------------- 10
Error Subsystem Methods --------------------------------------------------------------------- 11
3
NewDatabase------------------------------------------------------------------------------------- 35
OpenDatabase ----------------------------------------------------------------------------------- 36
ReleaseSecuritySeat --------------------------------------------------------------------------- 37
RunCalcs------------------------------------------------------------------------------------------- 38
SetCallbackPtr------------------------------------------------------------------------------------ 39
SetOption ------------------------------------------------------------------------------------------ 40
Unload ---------------------------------------------------------------------------------------------- 41
Database Object------------------------------------------------- 43
Overview --------------------------------------------------------------------------- 43
Database Object Properties --------------------------------------------------- 46
Name------------------------------------------------------------------------------------------------ 46
Status ----------------------------------------------------------------------------------------------- 47
4
TowerBurst ---------------------------------------------------------------------------------------- 87
TowerMerge--------------------------------------------------------------------------------------- 88
Appendix A-------------------------------------------------------109
Unit of Measure Codes ------------------------------------------------------- 109
Appendix B.………………………………………….…….112
PRO/II Object Reference…………………………………..………..112
5
Introduction
Overview
The objective of this guide is to explain the Application Programming Interface
(API) to the PRO/II COM Server. The PRO/II COM Server allows full read/write
access to PRO/II® simulation databases using Microsoft COM technology. Any
language or application that supports COM can use the methods and properties
described here. This includes Microsoft® Visual Basic®, Microsoft Excel, and
C++ applications written using the Win32 API, the MFC (Microsoft Foundation
Classes) framework, or the ATL (ActiveX Template Library) framework. The
examples in this document are written in Visual Basic (VB).
There are three types of objects available in the PRO/II COM Server:
Server Object: This singleton object is used to initialize and manage interaction
with the PRO/II COM Server.
Database Object: This object is used to interact with a specific simulation
database.
The PRO/II COM Server can open only one database at a time.
Data Object: Each “data object” is used to interact with a specific object in
PRO/II: components, thermodynamic systems, streams, and unit operations.
Data are read from and written to these objects using the GetAttribute and
PutAttribute methods.
Notes on Syntax
In this document, the syntax of the properties and methods is expressed in the
Visual Basic 6.0 language. This language is also used as the macro language for
Microsoft Excel.
Visual Basic allows the developer to implicitly define the data type of a variable
by ending it with a special character. This syntax is used in a number of the
examples in this document.
A variable name ending in a percent symbol, such as
Level%
Indicates that the variable is of Integer type.
A variable name ending in a “dollar” symbol, such as
objName$
This is indicates that the variable is of String type.
7 Introduction
The term “Nothing” is also used when referring to object variables. “Nothing” is a
reserved keyword in Visual Basic that is used to indicate that an object variable is
not assigned. When you assign the value of “Nothing” to an existing object
variable, Visual Basic will decrement the reference count of the COM object
associated with that variable by calling the COM function IUnknown::Release.
When the reference count drops to zero, the COM object will be deleted from
memory.
Notes on Examples
Each example is a complete Visual Basic program. You can copy these code
examples into your own Visual Basic or Excel macros and subroutines. The
examples use simulation databases that can be created with the keyword files
supplied with the PRO/II installation in the “user” and “user\applib” directories.
Before running one of the Visual Basic examples, you should start PRO/II with
PROVISION, import the keyword file, solve, save, and exit. At that point, the
simulation database (*.prz) will be ready.
The examples also assume that PRO/II 8.0 has been installed in the directory
“c:\simsci\proii80”. Modify the directory names in the examples if your installation
is different.
Further Reference
For further reference, see the following documents:
• PRO/II COM Server Programmer’s Guide and Tutorial: Provides an overview of
using Visual Basic to interact with the PRO/II COM Server.
Overview
The Server object must be created and initialized before any simulation database
can be created, opened, or solved. To create the “Server Object”, use the
language-specific method which creates a COM object. For example, the Visual
Basic code to create the “Server Object” is:
Dim P2SRV as Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
...
where "SimSciDbs.Database.80" is the “progid” of the specific version of PRO/II
COM Server to be created.
Once the Server object has been created, the properties and methods can be
used as described below and in the PRO/II COM Server Programmer’s Guide
and Tutorial.
The Server object has the following properties:
MsgCount Number of errors, warnings, and messages currently in the internal buffer.
Status Server status. Any method that causes an internal error will set this property
to a non-zero value.
The Server object has the two methods which are as follows:
1. General Server and File Manipulation methods
2. Error Subsystem methods
Each method is described briefly here. Detailed information is available in the
following section, Server Object Methods.
9 Server Object
General Server and File Manipulation Methods
DbsGetAttrId Returns the numeric identifier corresponding to the supplied
class identifier and name of a PRO/II attribute.
GetClassCount Returns the number of object classes available from the PRO/II
COM server.
GetClassNames Returns the individual object class name specified by the index.
GetGroupClassNames Returns the object class name belonging to the specified group
name and corresponding to the specified index.
Unload Shuts down the database access features of the COM server in
preparation for RunCalcs or GenerateReport. (Deprecated
since 7.1)
11 Server Object
Server Object Properties
DebugLevel
Description
Returns or sets the level determining the amount of debug information to write to the
debug output file. The name of the debug output file is specified in the Initialize
method. The recognized levels are:
Syntax
level% = object.DebugLevel
Syntax
IniFile$ = object.INIFile
13 Server Object
MsgCount
Description
Returns the number of errors, warnings, and messages in the internal message
buffer.
Methods such as FlashStream or Commit may write detailed informational
messages or errors to the internal buffer. Use MsgCount and MsgText to retrieve
these messages.
Syntax
msgcount% = object.MsgCount
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
P2SRV.ClearMsgs
' Perform flash and display the results
sResults$ = P2DB.FlashStream("1")
MsgBox sResults$, vbOKOnly, "Flash Results"
Syntax
stat% = object.Status
15 Server Object
Server Object Methods
ClearMsgs
Description
Removes all errors, warnings, and messages from the internal buffer. This method is
typically used before a method such as FlashStream or Commit to clear the internal
message buffer.
Syntax
object.ClearMsgs
Return Value
None.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
P2SRV.ClearMsgs
' Perform flash and display the results
sResults$ = P2DB.FlashStream("1")
MsgBox sResults$, vbOKOnly, "Flash Results"
Syntax
attrid% = object.DbsGetAttrId(classId, attrName)
Arguments
Return Value
The numeric code corresponding with the PRO/II attribute for the specified object
class.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
classid% = P2SRV.DbsGetClassId("Stream")
attrid% = P2SRV.DbsGetAttrId(classid%, "Temperature")
Set P2SRV = Nothing
17 Server Object
DbsGetClassId
Description
Each object class in PRO/II is identified by a name such as "StreamIn" or “Valve”.
This method returns the numeric identifier corresponding to the text string. The
numeric identifier can be used in methods requiring a numeric class identifier, such as
DbsGetAttrId.
This method is not typically used in a PRO/II COM application.
Syntax
classid% = object.DbsGetClassId(className)
Arguments
Return Value
The numeric code corresponding with the PRO/II object class.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
classid% = P2SRV.DbsGetClassId("Stream")
attrid% = P2SRV.DbsGetAttrId(classid%, "Temperature")
Set P2SRV = Nothing
Syntax
retCode% = object.Export(dbName, keywordFile)
Arguments
Return Value
0 – no errors
5 – specified simulation database was not found
Example
Dim P2SRV As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
p2KwdFile$ = "c:\SimSci\proii80\user\Applib\R3R_new.inp"
retCode% = P2SRV.Export(p2Database$, p2KwdFile$)
Set P2SRV = Nothing
19 Server Object
GenerateReport
Description
This generates a report for the specified simulation. The name of the report will be the
name of the simulation database with the extension “.out”.
Syntax
retCode% = object.GenerateReport(dbName)
Arguments
Return Value
<0 – security missing or improperly installed
1 – completed with no errors or warnings
2 – completed with warnings
3 – errors were generated
5 – specified simulation database was not found
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
retCode% = P2SRV.GenerateReport(p2Database)
' the name of the report is R3R.OUT
Set P2SRV = Nothing
Syntax
clscount% = object.GetClassCount
Arguments
None.
Return Value
The number of object classes.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
clscount% = P2SRV.GetClassCount
For i% = 0 To clscount% - 1
clsname$ = P2SRV.GetClassNames(i%)
Next
Set P2SRV = Nothing
21 Server Object
GetClassNames
Description
Returns the name of an object class with the specified index. This function is typically
used with the GetClassCount method.
Syntax
clsname$ = object.GetClassNames(index)
Arguments
Return Value
The class name returned as a string.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
clscount% = P2SRV.GetClassCount
For i% = 0 To clscount% - 1
clsname$ = P2SRV.GetClassNames(i%)
Next
Set P2SRV = Nothing
Syntax
clscount% = object.GetGroupClassCount(groupName)
Arguments
Return Value
The number of PRO/II object classes in the specified group.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
clscount% = P2SRV.GetGroupClassCount("Unit")
For i% = 0 To clscount% - 1
clsname$ = P2SRV.GetGroupClassNames("Unit", i%)
Next
Set P2SRV = Nothing
23 Server Object
GetGroupClassNames
Description
The object classes in PRO/II are organized into “groups”. For example, the “Valve”
class and the “Pump” class both belong to the "Unit" group. A client application can
use this function in a loop to get the list of all classes in the specified group. The total
number of classes can be obtained using the method GetGroupClassCount. Using a
specific group name, the client application can use the function
GetGroupClassNames to get the list of all classes in a group. (The first element is
specified using a value of zero for the index.)
Syntax
clsname$ = object.GetGroupClassNames(groupName, index)
Arguments
Index The index of the class name to retrieve. Specify 0 to return the
first class name.
Return Value
The name of the object class for the specified group at the specified index.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
clscount% = P2SRV.GetGroupClassCount("Unit")
For i% = 0 To clscount% - 1
clsname$ = P2SRV.GetGroupClassNames("Unit", i%)
Next
Set P2SRV = Nothing
Syntax
grpcount% = object.GetGroupCount
Arguments
None.
Return Value
The number of PRO/II object class groups.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
grpcount% = P2SRV.GetGroupCount
For i% = 0 To grpcount% - 1
grpname$ = P2SRV.GetGroupNames(i%)
Next
Set P2SRV = Nothing
25 Server Object
GetGroupNames
Description
The object classes in PRO/II are organized into “groups”. For example, the “Valve”
class and the “Pump” class both belong to the "Unit" group. The total number of
groups can be obtained using the method GetGroupCount. This method can be
used in a loop to get the individual group names. Then, using a specific group name,
the client application can use the function GetGroupClassNames to get the list of all
classes in a group. (Usually used in conjunction with GetGroupCount method) (The
first element is specified using a value of zero for the index.)
Syntax
grpname$ = object.GetGroupNames(index)
Arguments
Index The index of the group name to retrieve. Specify 0 to return the
first group name.
Return Value
The group name for specified index.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
grpcount% = P2SRV.GetGroupCount
For i% = 0 To grpcount% - 1
grpname$ = P2SRV.GetGroupNames(i%)
Next
Set P2SRV = Nothing
Syntax
value$ = object.GetOption(optionName)
Arguments
Return Value
Value of the option. The value is returned as a text string.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Value1$ = P2SRV.GetOption("showInternalObjects")
Value2$ = P2SRV.GetOption("DoublePrecision")
Set P2SRV = Nothing
27 Server Object
GetSecuritySeat
Description
This acquires a software security seat so that subsequent calls to security-aware
methods will not need to perform individual security operations.
This method can be used to improve performance. A method like
CalculateStreamProps will acquire a security seat, perform the calculations, and
then release the security seat. If the application needs to make many calls to security-
aware methods, then it is more efficient to make one call to get the security and then
make the multiple calls to the security-aware method.
Syntax
retCode% = object.GetSecuritySeat(level)
Arguments
Return Value
0 – no error
<0 – security missing or improperly installed
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database)
' Get a security license (for better performance)
retCode% = P2SRV.GetSecuritySeat(2)
nStreams% = P2DB.GetObjectCount("Stream")
For i% = 0 To (nStreams% - 1)
objName$ = P2DB.GetObjectNames("Stream", i%)
P2DB.CalculateStreamProps (objName$)
Next
' Release the security license
P2SRV.ReleaseSecuritySeat
Syntax
retCode% = object.Import(dbName)
Arguments
Return Value
<0 – security missing or improperly installed
1 – completed with no errors or warnings
2 – completed with warnings
3 – errors were generated
5 – specified keyword file was not found
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
p2KwdFile$ = "c:\SimSci\proii80\user\Applib\R3R.inp"
retCode% = P2SRV.Import(p2KwdFile$)
Set P2SRV = Nothing
29 Server Object
Initialize
Description
Initializes the PRO/II COM Server. This method must be called before any other
methods are invoked. To release (close) the server at the end of the application, set
the object variable to “Nothing.”
Syntax
object.Initialize(config, schema, debug)
Arguments
config Optional. The full path and name of the PRO/II initialization
file. If not specified, then it will use the installation-time
default read from the Windows Registry key
“HKEY_LOCAL_MACHINE/Software/Simulation
Sciences/PRO/II/8.0/Ini_File”, where “8.0” refers to the
specific version of PRO/II being used.
schema Optional. The name of the PRO/II schema file. This file
contains the information on what classes and their attributes
are available in the PRO/II database. If not specified, the
value is read from the “config” file.
Return Value
None.
Example
Using all defaults:
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
...
31 Server Object
MsgText
Description
Returns the text of an error, warning, or message in the internal message buffer.
Syntax
text$ = object.MsgText(index)
Arguments
Return Value
The text string of the error, warning, or message.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
P2SRV.ClearMsgs
' Perform flash and display the results
sResults$ = P2DB.FlashStream("1")
MsgBox sResults$, vbOKOnly, "Flash Results"
Syntax
code% = object.MsgCode(index)
Arguments
Return Value
The integer code for the error, warning, or message.
Example
See MsgText.
33 Server Object
MsgSeverity
Description
Returns the severity level for an error, warning, or message in the internal message
buffer.
Syntax
severity% = object.MsgSeverity(index)
Arguments
Return Value
The integer severity code for the error, warning, or message.
Example
See MsgText.
Syntax
Set P2DB = object.NewDatabase(dbname)
Arguments
dbname The path and name of the database to create. Do not include
the file extension.
Return Value
A Database Object.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2NewDB$ = "c:\SimSci\proii80\User\MyNewDB"
Set P2DB = P2SRV.NewDatabase(p2NewDB$)
Set P2DB = Nothing
Set P2SRV = Nothing
35 Server Object
OpenDatabase
Description
Opens an existing PRO/II simulation database. To close the database, set the object
variable to Nothing.
Syntax
Set P2DB = object.OpenDatabase(dbname)
Arguments
Return Value
A Database Object.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
object.ReleaseSecuritySeat
Arguments
None.
Return Value
None.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database)
' Get a security license (for better performance)
retCode% = P2SRV.GetSecuritySeat(2)
nStreams% = P2DB.GetObjectCount("Stream")
For i% = 0 To (nStreams% - 1)
objName$ = P2DB.GetObjectNames("Stream", i%)
P2DB.CalculateStreamProps (objName$)
Next
' Release the security license
P2SRV.ReleaseSecuritySeat
37 Server Object
RunCalcs
Description
Solves the specified simulation.
An application should call CheckData before running the simulation.
Syntax
retCode% = object.RunCalcs(dbName)
Arguments
Return Value
<0 – security missing or improperly installed
1 – simulation solved with no errors or warnings
2 – simulation solved with warnings
3 – simulation solved with errors
4 – simulation not solved
5 – specified keyword file was not found
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\G3.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
retCode% = P2DB.CheckData
Set P2DB = Nothing
nMsg% = P2SRV.MsgCount
If nMsg% > 0 Then
For i% = 0 To (nMsg% - 1)
sMessage$ = P2SRV.MsgText(i%)
Next
End If
retCode% = P2SRV.RunCalcs(p2Database$)
Set P2SRV = Nothing
Arguments
Not applicable.
Return Value
Not applicable.
Example
Not applicable.
39 Server Object
SetOption
Description
Sets the value of an option in the PRO/II COM server. The recognized options are
listed in the table:
"DoublePrecision" Specifies whether the COM Server will return floating point
values in single precision or double precision. If the option
value is set to "0" then single precision is used. If the value
is set to "1" then double precision is used. The default is to
use single precision, which is the behavior in version 7.1
and previous.
Syntax
retCode% = object.SetOption(optionName, optionValue)
Arguments
Return Value
0 – no error
1 – optionName is not recognized
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
retCode% = P2SRV.SetOption("showInternalObjects", "1")
retCode% = P2SRV.SetOption("DoublePrecision", "1")
Set P2SRV = Nothing
Syntax
object.Unload
Arguments
None.
Return Value
None.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
' PVSRV.Unload is automatically called as part of
' the next statement
Set P2SRV = Nothing
41 Server Object
Database Object
Overview
This object encapsulates a PRO/II simulation database. Use the OpenDatabase
or NewDatabase methods of the Server object to access this object. With this
object, an application can access specific units and streams in the database
using the ActivateObject method.
The Database object has the following properties:
43 Database Object
BuildThermoCalc Creates the calculation-time thermodynamic
data objects in preparation for thermo
calculations and the RunCalcs method.
45 Database Object
Database Object Properties
Name
The Database File Object.
Description
Returns the object name. This is the name that was originally used in NewDatabase
or OpenDatabase.
Syntax
Dbname$ = object.Name
Syntax
Status% = object.Status
47 Database Object
Database Object Methods
ActivateObject
Description
Loads a data object from the database into memory, making it available to the
application. To free the object, set the object variable to Nothing.
For a list of available data classes, refer to the PRO/II Object Reference. The
methods GetClassNames or GetGroupClassNames can also be used to query the
PRO/II COM server for the list of supported class names.
To get the list of objects for a specified class that actually exists in the simulation
database, use the method GetObjectNames.
Syntax
Set P2OBJ = object.ActivateObject(objclass, objname)
Arguments
Return Value
A Database Data Object. If the named object does not exist in the database, the
return value will be Nothing.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim P2OBJ As Object
Set P2OBJ = P2DB.ActivateObject("Stream", "1")
dTemp = P2OBJ.GetAttribute("Temperature")
Set P2OBJ = Nothing
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
object.BuildCompCalc
Arguments
None.
Return Value
None.
Example
For a detailed example of the use of BuildCompCalc as part of a generic “flash”
utility, refer to example XXX in the Tutorial section.
49 Database Object
BuildExecSequence
Description
Creates the unit operation execution sequence in preparation for the RunCalcs
method.
Note: this method is automatically called as part of the CheckData method. PRO/II
COM applications should call the CheckData method.
Syntax
object.BuildExecSequence
Arguments
None.
Return Value
None.
Example
See the CheckData method.
Syntax
object.BuildRefStreams
Arguments
None.
Return Value
None.
Example
See the CheckData method.
51 Database Object
BuildStreamCalc
Description
Creates the calculation-time stream data objects in preparation for the RunCalcs
method.
Note: this method is automatically called as part of the CheckData method. PRO/II
COM applications should call the CheckData method.
Syntax
object.BuildStreamCalc
Arguments
None.
Return Value
None.
Example
See the CheckData method.
Syntax
object.BuildThermoCalc
Arguments
None.
Return Value
None.
Example
See the CheckData method.
53 Database Object
CalculateStreamProps
Description
Calculates a full set of properties for the specified stream.
The RunCalcs and FlashStream methods do not automatically calculate all
properties for streams. Use this method following a call to FlashStream (or following
a call to RunCalcs and OpenDatabase) to create, if necessary, and update the
SrBulkProp and SrDecProp objects for the named stream.
Important: if the application is calculating properties for stream "1" then it is important
that all active stream objects named "1" (of class StreamIn, Stream, SrBulkProp, and
SrDecProp) be freed from memory by setting their object variables to Nothing.
Syntax
retCode = object.CalculateStreamProps(objname)
Arguments
Return Value
Boolean value: true = no error, false = error during calculations. Use the Status
property to retrieve the underlying error code.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim retCode As Boolean
retCode = P2DB.CalculateStreamProps("1")
Dim P2OBJ1 As Object
Dim P2OBJ2 As Object
Syntax
retCode = object.CalculateStreamProps2(objname, propertyoption)
Arguments
Return Value
Boolean value: true = no error, false = error during calculations. Use the Status
property to retrieve the underlying error code.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim retCode As Boolean
retCode = P2DB.CalculateStreamProps2("1", "")
retCode = P2DB.CalculateStreamProps2("1", "all")
55 Database Object
retCode = P2DB.CalculateStreamProps2("1", "std")
retCode = P2DB.CalculateStreamProps2("1", "std,tbp")
retCode = P2DB.CalculateStreamProps2("1", "std,rvp")
retCode = P2DB.CalculateStreamProps2("1", _
"std,tbp,bpdp")
Syntax
retCode = object.CalculateUnitProps(unitId)
Arguments
Return Value
Boolean value: true = no error, false = error during calculations. Use the Status
property to retrieve the underlying error code.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R1.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim retCode As Boolean
retCode = P2DB.CalculateUnitProps("HC1")
Dim P2OBJ As Object
Set P2OBJ = P2DB.ActivateObject("HcurveIn", "HC1")
hccalcname$ = P2OBJ.GetAttribute("HCURVE", 0)
Set P2OBJ = Nothing
Set P2OBJ = P2DB.ActivateObject( _
"HcurveCalc", hccalcname$)
totalEnthalpyArray = P2OBJ.GetAttribute( _
57 Database Object
"EnthalpyTotal", -1)
For i% = LBound(totalEnthalpyArray) To _
UBound(totalEnthalpyArray)
enthalpy = totalEnthalpyArray(i%)
Next
Set P2OBJ = Nothing
Syntax
retCode% = object.CheckData
Arguments
None.
Return Value
0 if no error. 1 if error. To get the specific error messages that were generated, use
the methods MsgCount and MsgText properties of the Server object.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\G3.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
retCode% = P2DB.CheckData
Set P2DB = Nothing
nMsg% = P2SRV.MsgCount
If nMsg% > 0 Then
For i% = 0 To (nMsg% - 1)
59 Database Object
sMessage$ = P2SRV.MsgText(i%)
Next
End If
retCode% = P2SRV.RunCalcs(p2Database$)
Set P2SRV = Nothing
Syntax
objNum% = object.ConvertIdToNum(dbObjType, objId)
Arguments
dbObjType The Object type. Valid values are "Unit" and “loop”.
Return Value
The internal numeric identifier of the PRO/II object.
Example
Not available.
61 Database Object
ConvertNumToId
Description
Returns the name of the PRO/II object specified by its internal number. This method
is required for some situations where the attribute of a PRO/II object is returned as a
number but that number needs to be converted to an actual object name for use in
ActivateObject.
Syntax
ObjName$ = object.ConvertNumToId(dbObjType, objNumber)
Arguments
dbObjType The Object type. Valid values are "Unit" and “loop”.
objNumber The internal object number. Specify 1 for the first object.
Return Value
The name of the PRO/II object.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
ObjName$ = P2DB.ConvertNumToId("Unit", 1)
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
object.ConvertValue(value, uomclass, fromtype, totype)
Arguments
fromtype Character code identifying what to convert the value from. One
of “input”, "output", “English”, “Metric”, or “SI”.
totype Character code identifying what to convert the value to. One of
“input”, "output", “English”, “Metric”, or “SI”.
Return Value
The converted value.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim P2OBJ As Object
Set P2OBJ = P2DB.ActivateObject("Stream", "1")
dTemp = P2OBJ.GetAttribute("Temperature")
dPres = P2OBJ.GetAttribute("Pressure")
dRate = P2OBJ.GetAttribute("TotalMolarRate")
dTemp2 = P2DB.ConvertValue( _
dTemp, "TEMP", "internal", "output")
dPres2 = P2DB.ConvertValue( _
dPres, "PRES", "internal", "output")
dRate2 = P2DB.ConvertValue( _
dRate, "MRAT", "internal", "output")
uomT = P2DB.GetUOMString("TEMP", "output")
uomP = P2DB.GetUOMString("PRES", "output")
uomR = P2DB.GetUOMString("MRAT", "output")
63 Database Object
MsgBox "Temperature = " & dTemp2 & " " & uomT, _
vbOKOnly, "Temperature"
MsgBox "Pressure = " & dPres2 & " " & uomP, _
vbOKOnly, "Pressure"
MsgBox "Flowrate = " & dRate2 & " " & uomR, _
vbOKOnly, "Flowrate"
Set P2OBJ = Nothing
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
object.ConvertValue2(value, uomclass, fromtype, totype)
Arguments
fromtype Character code identifying what to convert the value from. One
of “input”, "output", “English”, “Metric”, or “SI”.
totype Character code identifying what to convert the value to. One of
“input”, "output", “English”, “Metric”, or “SI”.
Return Value
The converted value.
Example
See ConvertValue
65 Database Object
CopyTrayToStream
Description
Copies the flowrate, thermal conditions, and composition data from a column tray to a
stream.
Syntax
retCode = object.CopyTrayToStream(columnname, tray, phase, subphase, net,
streamname)
Arguments
streamname The name of the stream to which the tray information is copied.
Return Value
Boolean value: true = no error, false = error during calculations. Use the Status
property to retrieve the underlying error code.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
' Ensure that merged column results have been
' copied back to original column/sidestrippers.
P2DB.TowerBurst
Dim P2OBJ As Object
Set P2OBJ = P2DB.ActivateObject("Column", "COL1")
nTrays = P2OBJ.GetAttribute("NumberOfTrays")
Set P2OBJ = Nothing
' Create temporary stream
tmpStream$ = "$TMPSTR"
Set P2OBJ = P2DB.CreateObject("Stream", tmpStream$)
Set P2OBJ = Nothing
67 Database Object
CreateObject
Description
Creates a new object of the specified class in the database and activates it into
memory. To free the object (remove it from memory), set the object variable to
Nothing. To delete the object from the database, use DeleteObject.
Syntax
Set P2OBJ = object.CreateObject(objclass, objname)
Arguments
Return Value
A Database Data Object.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim P2OBJ As Object
' Create new stream object
tmpStream$ = "$TMPSTR"
Set P2OBJ = P2DB.CreateObject("Stream", tmpStream$)
Syntax
object.CrossCheckControlUnitOps
Arguments
None.
Return Value
None.
Example
See the CheckData method.
69 Database Object
CrossCheckSpecsVarys
Description
Performs cross checks on all spec/vary/define objects in a flowsheet in preparation
for RunCalcs.
Note: this method is automatically called as part of the CheckData method. PRO/II
COM applications should call the CheckData method.
Syntax
object.CrossCheckSpecsVarys
Arguments
None.
Return Value
None.
Example
See the CheckData method.
Syntax
object.CrossCheckUnitOps
Arguments
None.
Return Value
None.
Example
See the CheckData method.
71 Database Object
DbsSaveDb
Description
Saves this database to its permanent location.
Syntax
retCode = object.DbsSaveDb
Arguments
None.
Return Value
Boolean value: true = no error, false = error. Use the Status property to retrieve the
underlying error code.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2NewDB$ = "c:\SimSci\proii80\User\MyNewDB"
Set P2DB = P2SRV.NewDatabase(p2NewDB$)
Dim retCode As Boolean
retCode = P2DB.DbsSaveDb
Syntax
object.DeleteObject(objclass, objname)
Arguments
Return Value
None.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim P2OBJ As Object
' Create new stream object
tmpStream$ = "$TMPSTR"
Set P2OBJ = P2DB.CreateObject("Stream", tmpStream$)
73 Database Object
FlashStream
Description
Performs a flash calculation on the specified stream.
Note: the component slate, their compositions and the desired thermodynamic
method must have been selected prior to performing the flash calculation.
Syntax
Results$ = object.FlashStream(objname)
Arguments
Return Value
A text string containing the results of the flash.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
P2SRV.ClearMsgs
' Perform flash and display the results
sResults$ = P2DB.FlashStream("1")
MsgBox sResults$, vbOKOnly, "Flash Results"
' If there are errors or messages get them here
nMsg% = P2SRV.MsgCount
If nMsg% > 0 Then
For i% = 0 To (nMsg% - 1)
sMessage$ = P2SRV.MsgText(i%)
Next
End If
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
object.GenerateAssayComponents
Arguments
None.
Return Value
None.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
' Change assay of existing stream
Set P2OBJ = P2DB.ActivateObject("StreamAsIn", "1")
P2OBJ.PutAttribute 11, "Temperatures"
P2OBJ.PutAttribute 3, "DistPct", 0
P2OBJ.PutAttribute 5, "DistPct", 1
P2OBJ.PutAttribute 10, "DistPct", 2
P2OBJ.PutAttribute 20, "DistPct", 3
P2OBJ.PutAttribute 30, "DistPct", 4
P2OBJ.PutAttribute 40, "DistPct", 5
P2OBJ.PutAttribute 50, "DistPct", 6
P2OBJ.PutAttribute 60, "DistPct", 7
P2OBJ.PutAttribute 70, "DistPct", 8
P2OBJ.PutAttribute 80, "DistPct", 9
P2OBJ.PutAttribute 100, "DistPct", 10
P2OBJ.PutAttribute 97, "DistTemp", 0
P2OBJ.PutAttribute 149, "DistTemp", 1
P2OBJ.PutAttribute 208, "DistTemp", 2
P2OBJ.PutAttribute 330, "DistTemp", 3
P2OBJ.PutAttribute 459, "DistTemp", 4
P2OBJ.PutAttribute 590, "DistTemp", 5
P2OBJ.PutAttribute 690, "DistTemp", 6
75 Database Object
P2OBJ.PutAttribute 770, "DistTemp", 7
P2OBJ.PutAttribute 865, "DistTemp", 8
P2OBJ.PutAttribute 980, "DistTemp", 9
P2OBJ.PutAttribute 1600, "DistTemp", 10
P2OBJ.Commit True
Set P2OBJ = Nothing
P2DB.GenerateAssayComponents
retCode% = P2DB.CheckData
Set P2DB = Nothing
retCode% = P2SRV.RunCalcs(p2Database$)
Set P2SRV = Nothing
Syntax
Count% = object.GetObjectCount(classname)
Arguments
Return Value
The object count.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
objcount% = P2DB.GetObjectCount("Stream")
For i% = 0 To objcount% - 1
objname$ = P2DB.GetObjectNames("Stream", i%)
Next
Set P2DB = Nothing
Set P2SRV = Nothing
77 Database Object
GetObjectNames
Description
Returns the name of an object with the specified class and index. This function is
typically used with the GetObjectCount method.
Syntax
object.GetObjectNames(classname, index)
Arguments
Return Value
The object name returned as a string.
Example
See GetObjectCount.
Syntax
object.GetUOMString(uomclass, type)
Arguments
uomclass The name of the unit-of-measure class. Appendix A lists the valid
codes.
Return Value
The unit-of-measure string.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim P2OBJ As Object
Set P2OBJ = P2DB.ActivateObject("Stream", "1")
dTemp = P2OBJ.GetAttribute("Temperature")
dPres = P2OBJ.GetAttribute("Pressure")
dRate = P2OBJ.GetAttribute("TotalMolarRate")
dTemp2 = P2DB.ConvertValue( _
dTemp, "TEMP", "internal", "output")
dPres2 = P2DB.ConvertValue( _
dPres, "PRES", "internal", "output")
dRate2 = P2DB.ConvertValue( _
dRate, "MRAT", "internal", "output")
uomT = P2DB.GetUOMString("TEMP", "output")
uomP = P2DB.GetUOMString("PRES", "output")
uomR = P2DB.GetUOMString("MRAT", "output")
MsgBox "Temperature = " & dTemp2 & " " & uomT, _
vbOKOnly, "Temperature"
MsgBox "Pressure = " & dPres2 & " " & uomP, _
vbOKOnly, "Pressure"
MsgBox "Flowrate = " & dRate2 & " " & uomR, _
79 Database Object
vbOKOnly, "Flowrate"
Set P2OBJ = Nothing
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
object.GetUOMString2(uomclass, opt, type)
Arguments
uomclass The name of the unit-of-measure class. Appendix A lists the valid
codes.
Return Value
The unit-of-measure string.
Example
Not available.
81 Database Object
MiscChecks
Description
Performs final checks on a flowsheet in preparation for RunCalcs.
Note: this method is automatically called as part of the CheckData method. PRO/II
COM applications should call the CheckData method.
Syntax
object.MiscChecks
Arguments
None.
Return Value
None.
Example
See the CheckData method.
Syntax
objExists = object.ObjectExists(objclass, objname)
Arguments
Return Value
Boolean value - “True” if an object of the specified name and class exists in the
simulation database, otherwise “False”.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim objExists As Boolean
objExists = P2DB.ObjectExists("Stream", "1")
objExists = P2DB.ObjectExists("Stream", "XXXXX")
Set P2DB = Nothing
Set P2SRV = Nothing
83 Database Object
ObjectExistsInGroup
Description
Returns ‘true’ if the specified name belongs to an object in the database in the same
group.
A “group” of object classes defines a namespace. For example, “Pump” and “Valve”
objects belong to the "Unit" group; therefore, there cannot be a pump named “XX”
and a valve named “XX” in the same database. A stream, however, belongs to a
different group, the "Stream" group. Therefore a simulation database can have a
pump named “XX” and a stream named “XX”.
This method can be used before calling CreateObject to create a new object of a
specified class. The return value will indicate if there is a name conflict with an
already-existing unit or stream.
Syntax
object.ObjectExistsInGroup(objclass, objname)
Arguments
Return Value
Boolean value - “True” if an object of the specified name exists in the same group as
the specified class, otherwise “False”.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim objExists As Boolean
' Application wants to create a splitter named SS01
' Is the name already used by another unit?
objExists = P2DB.ObjectExistsInGroup("Splitter", "SS01")
' If so, try another name
objExists = P2DB.ObjectExistsInGroup( _
"Stream", "SPLIT01")
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
object.RenameObject(objclass, objname, newname)
Arguments
Return Value
None.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Status% = P2DB.Status
P2DB.RenameObject "Stream", "1", "STREAM1"
Status% = P2DB.Status
Set P2DB = Nothing
Set P2SRV = Nothing
85 Database Object
RestoreInputData
Description
Resets the flowsheet calculation status. Previously-calculated results are deleted for
the current flowsheet, allowing a complete re-initialization of all columns; recycle
streams, and calculator results back to their initial input data.
This feature is particularly useful if a particular what-if scenario involves substantially
different operation from the previous run, or if multiple calculator units need to have
their results array reset.
Syntax
retValue = object.RestoreInputData(resetFlag)
Arguments
Return Value
Boolean value: true = no error, false = error during calculations. Use the Status
property to retrieve the underlying error code.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\G3.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim boolCode As Boolean
boolCode = P2DB.RestoreInputData(1)
retCode% = P2DB.CheckData
Set P2DB = Nothing
retCode% = P2SRV.RunCalcs(p2Database$)
Set P2SRV = Nothing
Syntax
object.TowerBurst
Arguments
None.
Return Value
None.
Example
See the CopyTrayToStream method.
87 Database Object
TowerMerge
Description
Merges eligible column/sidestripper combinations into single column object in
preparation for RunCalcs.
Note: this method is automatically called as part of the CheckData method. PRO/II
COM applications should call the CheckData method.
Syntax
object.TowerMerge
Arguments
None.
Return Value
None.
Example
See the CheckData method.
Overview
An object of this type represents a specific simulation data object in PRO/II. All
streams, components, thermodynamic methods, reaction data sets, streams, and
unit operations are Database Data Objects.
The PRO/II Object Reference documents the PRO/II data classes and their
attributes.
The Database Data objects have the following properties:
Syntax
objName$ = object.Name
Syntax
Status% = object.Status
Syntax
object.Commit(full)
Arguments
Return Value
None.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim P2OBJ As Object
Set P2OBJ = P2DB.ActivateObject("Stream", "1")
dTemp = P2OBJ.GetAttribute("Temperature")
P2OBJ.PutAttribute 450#, "Temperature"
P2OBJ.Commit True
dTemp2 = P2OBJ.GetAttribute("Temperature")
Set P2OBJ = Nothing
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
Value = object.GetAttribute(attrname, index)
Arguments
index Optional. Index of array attribute to return. Not used for scalar
attributes. For array attributes, specify 0 for the first element;
specify -1 to return the entire array.
Return Value
The value of the attribute returned as a variant. The value can be integer, floating
point, or character, depending on the attribute. ‘Empty’ will be returned if the
database value is missing.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim P2OBJ As Object
Set P2OBJ = P2DB.ActivateObject("Stream", "1")
' Scalar attribute
dTemp = P2OBJ.GetAttribute("Temperature")
' Single elements of an array attribute
fracCount = P2OBJ.UnitCount("TotalComposition")
For i% = 0 To fracCount - 1
dFracElement = P2OBJ.GetAttribute( _
"TotalComposition", i%)
Next
' Complete array attribute
dFracArray = P2OBJ.GetAttribute("TotalComposition", -1)
For i% = LBound(dFracArray) To UBound(dFracArray)
dFracElement = dFracArray(i%)
Next
Set P2OBJ = Nothing
Set P2DB = Nothing
Syntax
attrCount% = object.GetAttributeCount
Arguments
None.
Return Value
The number of attributes in the object returned as an integer.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim P2OBJ As Object
Set P2OBJ = P2DB.ActivateObject("Stream", "1")
attrcount% = P2OBJ.GetAttributeCount
For i% = 0 To attrcount% - 1
attrName$ = P2OBJ.GetAttributeName(i%)
dataSize% = P2OBJ.UnitSize(attrName)
dataCount% = P2OBJ.UnitCount(attrName)
attrType$ = P2OBJ.GetAttributeDataType(attrName)
attrSystemType$ = _
P2OBJ.GetAttributeSystemDataType(attrName)
attrUOM$ = P2OBJ.GetAttributeUOM(attrName)
Next
Set P2OBJ = Nothing
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
attrType$ = object.GetAttributeDataType(attrname)
Arguments
Return Value
The data type as a string. The data types are “INTEGER”, “REAL”, “DOUBLE”,
“SINGLE”, “STRING”, and “UOM”.
Example
See GetAttributeCount.
Syntax
attrName$ = object.GetAttributeName(index)
Arguments
Index The index of the object name to retrieve. Specify 0 for the first
object name.
Return Value
The attribute name returned as a string. The returned attribute name can be used in
methods such as GetAttribute and PutAttribute.
Example
See GetAttributeCount.
Syntax
systemType$ = object.GetAttributeSystemDataType(attrname)
Arguments
Return Value
The data type as a string. The data types include “I” (integer), “R” (real), “D” (double),
“S” (single), “STRING”, “UOM”, “SID” (stream ID) , “COID” (component ID) , “RSID”
(reaction set ID) , “MID” (thermodynamic method set ID).
Example
See GetAttributeCount.
Syntax
Uom$ = object.GetAttributeUOM(attrname)
Arguments
Return Value
The unit-of-measure code as a string (first four letters denoting the class name of the
UOM data type). A list of valid codes is given in Appendix A.
Example
See GetAttributeCount.
Syntax
object.GetThermoDefaults
Arguments
None.
Return Value
None.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
' Create a new Peng-Robinson Thermodynamic System
' in the database
Dim P2OBJ As Object
Set P2OBJ = P2DB.CreateObject("ThermoSet", "PR01")
P2OBJ.PutAttribute 1, "VLLEFlagInpt"
P2OBJ.PutAttribute 102, "SystemFlagInpt"
P2OBJ.GetThermoDefaults
P2OBJ.Commit 0
P2OBJ.PutAttribute 0, "KvalLLEDataFlg"
P2OBJ.PutAttribute 1, "LiqEnthDataFlg"
P2OBJ.PutAttribute 1, "VapEnthDataFlg"
P2OBJ.PutAttribute 0, "LiqDensDataFlg"
P2OBJ.PutAttribute 1, "VapDensDataFlg"
P2OBJ.PutAttribute 0, "VapPhiDataFlg"
P2OBJ.PutAttribute 1, "LiqEntrDataFlg"
P2OBJ.PutAttribute 1, "VapEntrDataFlg"
P2OBJ.Commit 1
Set P2OBJ = Nothing
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
object.PopCopy
Arguments
None.
Return Value
None.
Example
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
p2Database$ = "c:\SimSci\proii80\user\Applib\R3R.prz"
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim P2OBJ As Object
Set P2OBJ = P2DB.ActivateObject("StreamIn", "1")
dTemp = P2OBJ.GetAttribute("Temperature")
P2OBJ.PushNewCopy
P2OBJ.PutAttribute 450#, "Temperature"
dTemp2 = P2OBJ.GetAttribute("Temperature")
' Cancel changes since last PushNewCopy
P2OBJ.PopCopy
' Value has been restored to original
dTemp3 = P2OBJ.GetAttribute("Temperature")
P2OBJ.PushNewCopy
P2OBJ.PutAttribute 450#, "Temperature"
dTemp4 = P2OBJ.GetAttribute("Temperature")
' Confirm changes since last PushNewCopy
P2OBJ.PullPrevCopy
' New value has been retained
dTemp5 = P2OBJ.GetAttribute("Temperature")
P2OBJ.Commit True
Set P2OBJ = Nothing
Set P2DB = Nothing
Set P2SRV = Nothing
Syntax
object.PullPrevCopy
Arguments
None.
Return Value
None.
Example
See PopCopy.
Syntax
object.PushNewCopy
Arguments
None.
Return Value
None.
Example
See PopCopy.
Syntax
object.PutAttribute(value, attrname, index)
Arguments
value The value to store in the object. To store the missing value, use an ‘Empty’
variant variable.
index Optional. The index of the array element. Used only for array attributes.
Specify 0 to put a value for the first element.
Return Value
None.
Example
dbsSchemaFile$ = "c:\SimSci\proii80\System\Schema.sdf"
p2ConfigFile$ = "c:\SimSci\proii80\User\proii.ini"
p2Database$ = "c:\SimSci\proii80\user\G3.prz"
Dim P2SRV As Object
Set P2SRV = CreateObject("SimSciDbs.Database.80")
P2SRV.Initialize
Dim P2DB As Object
Set P2DB = P2SRV.OpenDatabase(p2Database$)
Dim P2OBJ As Object
Set P2OBJ = P2DB.ActivateObject("StreamIn", "1")
' Scalar attribute
dTemp = P2OBJ.GetAttribute("Temperature")
P2OBJ.PutAttribute 450#, "Temperature"
' Single elements of an array attribute
fracCount = P2OBJ.UnitCount("Composition")
newFracElement = 0.25
For i% = 0 To fracCount - 1
dFracElement = P2OBJ.GetAttribute("Composition", i%)
P2OBJ.PutAttribute newFracElement, "Composition", i%
Next
Syntax
Count% = object.UnitCount(attrName)
Arguments
Return Value
The number of elements for an array attributes. A scalar attribute will return a
value of 1.
Example
See GetAttributeCount.
Syntax
Size% = object.UnitSize(attrName)
Arguments
Return Value
The size, in bytes, of a scalar attribute; or the size of a single element of an array
attribute.
Example
See GetAttributeCount.
Temperature TEMP
Pressure PRES
Mass WT
Time TIME
Length LENG
Area AREA
Velocity VELO
Density DENS
109 Appendix A
Unit-of-Measure Class Code
Energy ENER
Duty DUTY
Enthalpy ENTH
Entropy ENTR
Heat Capacity CP
Viscosity VISC
Basis BASI
Phase PHAS
Fraction FRAC
Percentage PCT
Angle ANGL
111 Appendix A
Appendix B.
Pro II Object Reference
112 Appendix B
Table 1.1. Component data
Read an attribute: ComponentObject.GetAttribute(AttributeName, Index)
Write an attribute: ComponentObject.PutAttribute(AttributeName, Index)
114 Appendix B
Table 1.1. Component data
Read an attribute: ComponentObject.GetAttribute(AttributeName, Index)
Write an attribute: ComponentObject.PutAttribute(AttributeName, Index)
Correlated Data
- Correlation InT
numbers CorrelTypeIn Vector Correlation type number
- Temperature unit TEMP UOM Correlation temperature
CorrelTempUOMIn Vector unit
- Property unit UOM
CorrelPropUOMIn Vector Correlated prop unit
- Property basis InT
CorrelMolBasisIn Vector 1 - Mole, 2 - Weight
116 Appendix B
Table 1.1. Component data
Read an attribute: ComponentObject.GetAttribute(AttributeName, Index)
Write an attribute: ComponentObject.PutAttribute(AttributeName, Index)
Tabular Data
- Vapor
Pressure
- Number of data Vapor pressure table
points VapPressTabNumPtsIn InT number of points
- Temperatures TEMP Real Temperatures for tabular
VPTempTableIn Vector prop data
- Vapor pressure PRES Real Tabular data for Vapor
values VapPressTableIn Vector Pressure
- Temperature VapPressTabTempUOM TEMP Vapor pressure table temp
UOM In UOM unit
- Vapor pressure VapPressTabPropUOMI PRES Vapor pressure table prop
UOM n UOM unit
- vapor pressure
basis VapPressTabBasisIn InT 1 - Mole, 2 - Weight
- Solid Vapor
Pressure
- Number of data Solid Vapor Press table
points SolVPTabNumPtsIn InT number of points
- Temperatures TEMP Real Solids Temperatures for
SVPTempTableIn Vector tabular prop data
- Solid vapor PRES Real Tabular data for Solid
pressure values SolVapPressTableIn Vector Vapor Pressure
- Temperature TEMP Solid Vapor Press table
UOM SolVPTabTempUOMIn UOM temp unit
- Solid vapor PRES Solid Vapor Press table
pressure UOM SolVPTabPropUOMIn UOM prop unit
- Solid vapor
pressure basis SolVPTabBasisIn InT 1 - Mole, 2 - Weight
- Latent heat
- Number of data Latent Heat table number
points LatHtTabNumPtsIn InT of points
- Temperatures TEMP Real Temperatures for tabular
LHTempTableIn Vector prop data
- Latent heat ENTH Real Tabular data for Latent
values LatHtTableIn Vector Heat
- Temperature TEMP Latent Heat table temp
UOM LatHtTabTempUOMIn UOM unit
- Latent heat ENTH
UOM LatHtTabPropUOMIn UOM Latent Heat table prop unit
- Latent heat
basis LatHtTabBasisIn InT 1 - Mole, 2 - Weight
- Ideal gas
enthalpy
- Number of data Ideal Gas Enthalpy table
points IdGEnthTabNumPtsIn InT number of points
- Temperatures TEMP Real Temperatures for tabular
IGHTempTableIn Vector prop data
- Ideal gas ENTH Real Tabular data for Ideal Gas
enthalpy values IdealGasEnthTableIn Vector Enthalpy
- Temperature IdGEnthTabTempUOMI TEMP Ideal Gas Enthalpy table
UOM n UOM temp unit
- Ideal gas ENTH Ideal Gas Enthalpy table
enthalpy UOM IdGEnthTabPropUOMIn UOM prop unit of measure
- Ideal gas
enthalpy basis IdGEnthTabBasisIn InT 1 - Mole, 2 - Weight
- Sat. Liquid
enthalpy
- Number of data Sat Liquid Enthalpy table
points SLiqEnthTabNumPtsIn InT number of points
118 Appendix B
Table 1.1. Component data
Read an attribute: ComponentObject.GetAttribute(AttributeName, Index)
Write an attribute: ComponentObject.PutAttribute(AttributeName, Index)
120 Appendix B
Table 1.1. Component data
Read an attribute: ComponentObject.GetAttribute(AttributeName, Index)
Write an attribute: ComponentObject.PutAttribute(AttributeName, Index)
122 Appendix B
Table 1.1. Component data
Read an attribute: ComponentObject.GetAttribute(AttributeName, Index)
Write an attribute: ComponentObject.PutAttribute(AttributeName, Index)
Calculated Data
The calculated fixed property data for components are stored in the "CompCalc" class. There
is only one instance of this class and its name is also "CompCalc".
This object contains vectors for each component property and Property[i] belongs to
component ComponentId[i].
Calculated data, Class = CompCalc
- Component ID 0 to N-1 Comp
ID
ComponentId Vector Component ID (Name)
- Component type 1 - Library, 2 - Non-Library,
InT 3 - Petroleum, 4 - Assay
Vector pseudocomponent, 5 -
ComponentType Syncomp, 6 - Synliq
- Phase InT
Vector 1 - Vapor, 2 - Liquid, 3 -
Phase Solid
- Print number InT Component numbers
Vector entered in the PRO/II
PrintNumber keyword file
- CAS number InT
Vector
ChemAbsNum Chemical abstract number
124 Appendix B
Table 1.1. Component data
Read an attribute: ComponentObject.GetAttribute(AttributeName, Index)
Write an attribute: ComponentObject.PutAttribute(AttributeName, Index)
Thermodynamic
system selected SystemFlagInpt InT See Table 1
VLLE set flag 0 - Not a VLLE set, 1
VLLEFlagInpt InT - VLLE set
Default Methods
- K-Value (VLE) KvalVLEDflt InT Default VLE method
- K-Value (LLE) KvalLLEDflt InT Default LLE method
- K-Value (SLE) KvalSLEDflt InT Default SLE method
- Henry's law Default Henry's law
coefficient HenryDflt InT coefficient method
- Liquid enthalpy Default liquid
LiquidEnthalpyDflt InT enthalpy method
- Vapor enthalpy Default vapor
VaporEnthalpyDflt InT enthalpy method
- Liquid density Default liquid density
LiquidDensityDflt InT method
- Vapor density Default vapor
VaporDensityDflt InT density method
- Vapor fugacity Default vapor
(PHI) fugacity coefficient
VaporPhiDflt InT method
- Liquid entropy Default liquid
LiquidEntropyDflt InT entropy method
- Vapor entropy Default vapor
VaporEntropyDflt InT entropy method
- Liquid viscosity Default liquid
LiquidViscosityDflt InT viscosity method
- Vapor viscosity Default vapor
VaporViscosityDflt InT viscosity method
- Liquid conductivity Default liquid
LiquidConducDflt InT conductivity method
- Vapor conductivity Default vapor
VaporConducDflt InT conductivity method
- Surface tension Default surface
SurfaceTnsionDflt InT tension method
- Liquid diffusivity Default liquid
LiquidDiffusDflt InT diffusivity method
User-overridden
Methods
- K-Value (VLE) User override to
KvalVLEOvride InT default VLE method
- K-Value (LLE) User override to
KvalLLEOvride InT default LLE method
126 Appendix B
Table 2.1 Thermo data
Read an attribute: ThermoObject.GetAttribute(AttributeName, Index)
Write an attribute: ThermoObject.PutAttribute(AttributeName, Index)
Water Handling
Options
0 - Allow method
determine if water
will be decanted
1 - Turn off water
decant
unconditionally
2 - Turn on water
- water decant decant
option DecantOverrideInpt InT unconditionally
0/1 - use default
method
2 - use kerosene
data
- solubility option HCSolubOptionInpt InT 3 - use eos method
0 - Compute sat.
water props
1 - Compute actual
- water properties props using steam
option WaterPropsInpt InT tables
Binary InTeraction Parameters : Use the appropriate class names (refer Table 2) to access
the parameter data for the desired property
BWRS
Data applicable for K-Value (VLE), Liquid enthalpy, Vapor enthalpy, Liquid density, Vapor
density, Liquid entropy, Vapor entropy classes
- Number of pairs BWRSCount InT BWRS count
- Component i Comp ID
BWRSKijComp1 Vector BWRS i's
- Component j Comp ID
BWRSKijComp2 Vector BWRS j's
- kij Real
BWRSKij Vector Kij
128 Appendix B
Table 2.1 Thermo data
Read an attribute: ThermoObject.GetAttribute(AttributeName, Index)
Write an attribute: ThermoObject.PutAttribute(AttributeName, Index)
Lee-Kesler-
Plocker
Data applicable for K-Value (VLE), K-Value (LLE), Liquid enthalpy, Vapor enthalpy, Liquid
density, Vapor density, Liquid entropy, Vapor entropy classes
- Number of pairs LKP count . The
following vectors are
LKPCount InT sized to this count
- Component i Comp ID
LKPKijComp1 Vector LKP i's
- Component j Comp ID
LKPKijComp2 Vector LKP j's
- kij Real
LKPKij Vector Kij
Redlich-Kister,
Gamma Heat of
Mixing
Data applicable only for Liquid enthalpy class, Class = ThermoSet
- Heat of mixing Excess enthalpy flag
method applied to the 419 - Redlich-Kister
liquid enthalpy 1
method 420 - Redlich-Kister
ExcessEnthInpt InT 2
Data applicable only for Liquid enthalpy class, Class = ThHLiqIn
SRKP, PRP
- Number of binary
pairs KijTCount InT Kij(T) count
- Component i Comp ID.
KijTComp1 Vector Kij(T) i's
130 Appendix B
Table 2.1 Thermo data
Read an attribute: ThermoObject.GetAttribute(AttributeName, Index)
Write an attribute: ThermoObject.PutAttribute(AttributeName, Index)
132 Appendix B
Table 2.1 Thermo data
Read an attribute: ThermoObject.GetAttribute(AttributeName, Index)
Write an attribute: ThermoObject.PutAttribute(AttributeName, Index)
UNIQUAC
Data applicable for K-Value (VLE) and K-Value (LLE) classes only
UNIQUAC (2
parameter)
- Number of
component pairs UNIQUAC2Count InT UNIQUAC2 count
- Component i Comp ID.
UNIQUAC2Comp1 Vector i's
- Component j Comp ID.
UNIQUAC2Comp2 Vector j’s
- aij Real
UNIQUAC2Aij Vector Aij
- aji Real
UNIQUAC2Aji Vector Aji
- Unit of measure 1 - Kelvin, 2 -
InT KiloCalories, 3 -
UNIQUAC2Unit Vector KiloJoules
Azeotrope Data
- Number of
component pairs AzeoCount InT Count
- Component i Comp ID.
AzeoComp1 Vector i’s
- Component j Comp ID.
AzeoComp2 Vector j’s
- Pressure PRES Real
AzeoPress Vector Azeotrope Pressure
- Pressure unit of PRES
measure AzeoPunit UOM Pressure units
- Temperature TEMP Real Azeotrope
AzeoTemp Vector Temperature
- Temperature unit TEMP
of measure AzeoTunit UOM Temperature units
- xi Real Concentration at
AzeoConc Vector azeotrope
- Basis AzeoBasis InT Wt or Molar
Mutual
Solubility Data
- Number of
component pairs MutuCount InT Count
- Component i Comp ID.
MutuComp1 Vector i’s
- Component j Comp ID.
MutuComp2 Vector j’s
- Temperature TEMP Real
MutuTemp Vector Temperature
134 Appendix B
Table 2.1 Thermo data
Read an attribute: ThermoObject.GetAttribute(AttributeName, Index)
Write an attribute: ThermoObject.PutAttribute(AttributeName, Index)
Van Laar
Data applicable for K-Value (VLE) and K-Value (LLE) classes only
- Number of
component pairs VanlaarCount InT Count
- Component i Comp ID.
VanlaarComp1 Vector i’s
- Component j Comp ID.
VanlaarComp2 Vector j’s
Margules
Data applicable for K-Value (VLE) and K-Value (LLE) classes only
- Number of
component pairs MargulesCount InT Count
- Component i Comp ID.
MargulesComp1 Vector i’s
- Component j Comp ID.
MargulesComp2 Vector j’s
- aij Real
MargulesAij Vector Aij
- aji Real
MargulesAji Vector Aji
- dij Real
MargulesDij Vector Dij
Keyword
Thermodynamic Method Abbreviation InTernal ID
Ideal IDEAL 1
Soave-Redlich-Kwong SRK 101
Peng-Robinson PR 102
Grayson-Streed GS 103
Chao-Seader CS 104
Braun K10 BK10 105
Kabadi-Danner modifications to SRK SRKKD 108
Huron-Vidal modifications to SRK SRKH 109
Benedict-Webb-Rubin-Starling BWRS 110
Panagiotopoulos-Reid modifications to SRK SRKP 111
Huron-Vidal modifications to PR PRH 112
UNIWAALS UNIWAAL 113
Panagiotopoulos-Reid modifications to PR PRP 114
Hayden-O'Connell vapor fugacity HOCV 115
Modified Panagiotopoulos-Reid mods to SRK SRKM 116
136 Appendix B
Modified Panagiotopoulos-Reid mods to PR PRM 117
Grayson-Streed-Erbar GSE 118
Chao-Seader-Erbar CSE 119
Modifications to Grayson-Streed & Chao-Seader IGS 120
SimSci modifications to SRK SRKS 121
Associating Hexamer equation of state HEXAMER 122
Idimer vapor fugacity IDIMER 123
TACITE TACITE 124
SAFT SAFT 125
138 Appendix B
Table 3.1 Stream data
Read an attribute: StreamObject.GetAttribute(AttributeName, Index)
Write an attribute: StreamObject.PutAttribute(AttributeName, Index)
142 Appendix B
General Solid Attributes, Class = StrmMscIn
Number of components NumGenCmps N InT
with general solid data
Component Ids GenComp 0 to N-1 Comp
ID
Starting value index GenStart InT
Ending value index GenEnd InT
Value GenData Real Values between GenStart[i]
and GenEnd[i] indices belong
to GenComp[i]
The names of the general attributes are defined in CompGen object. The data supplied in
streams are the values for these general attribute names.
Calculated Stream Properties
Component IDs, Class = CompCalc
Component ID ComponentId 0 to Comp.
NOC -1 ID
Calculated Stream Properties, Class = Stream
Component mole TotalComposition 0 to Real
fractions NOC -1
Vapor phase VaporComposition 0 to Real
compositions NOC -1
Liquid phase LiquidComposition 0 to Real
compositions NOC -1
Solid phase SolidComposition 0 to Real
compositions NOC -1
Temperature Temperature TEMP Real
Pressure Pressure PRES Real
Mole flow rate TotalMolarRate MRAT Real
Mole fraction vapor VaporFraction Real
Mole fraction total liquid LiquidFraction Real
Mole fraction water or WaterFraction Real
L2 liquid
Inert weight rate InertWeightRate WTR Real
A
Weight fraction solids SolidFraction Real
Molar enthalpy TotalMolarEnthalpy ENTH Real
Molar entropy TotalMolarEntropy ENTR Real
Bulk Total Stream Properties, Class = SrBulkProp
Molecular weight BulkMwOfPhase Real
Accentric factor BulkAccenFactor Real
Tc BulkCritTemp TABS Real
Pc BulkCritPres PABS Real
Vc BulkCritVolume LIQV Real
Zc BulkCritZFactor Real
Density, Actual BulkDensityAct DENS Real
conditions
Density (Sp. Gravity), BulkDensityStd DENS Real
Std. Conditions
Thermal conductivity BulkThermalCond CON Real
D
Viscosity BulkViscosity VISC Real
Surface Tension BulkSurfTension SURF Real
144 Appendix B
Asphaltene content (C5) BulkAsphalteneC5 PPM Real
Asphaltene content (C7) BulkAsphalteneC7 PPM Real
Penetration index BulkPenetrationIndex Real
Freeze point BulkFreezePoint TEMP Real
temperature
Conradson carbon BulkConradsonCResid PCT Real
residue
Carbon-Hydrogen ratio BulkCToHRatio Real
Wax content BulkWaxContent PCT Real
Ash content BulkAshContent PCT Real
Octane number BulkROctaneNumber Real
(Research)
Octane number (Motor) BulkMOctaneNumber Real
Refractive index BulkRefrIndexC20 Real
Luminosity number BulkLuminosityNumber Real
Noack volatality BulkNoackVolatility Real
Cetane index BulkCetaneIndex Real
Mercaptan content BulkMercaptan PPM Real
Naphthalene content BulkNaphthalene PCT Real
Aniline point BulkAnalinePoint TEMP Real
Bromine number BulkBromineNumber Real
Neutralization number BulkNeutralization Real
Cold Filter Plug Point BulkCFPP TEMP Real
Softening point BulkSofteningPoint Real
Phenol content BulkPhenolContent PPM Real
Octane number (Motor, BulkMOctaneNumberL Real
3ML)
Octane number BulkROctaneNumberL Real
(Research, 3ML)
Sulfur content BulkAliphaticSulfur PCT Real
(Aliphatic)
Refractive index (70 C) BulkRefrIndexC70 Real
Aromatic Ring content BulkAromaticRing PCT Real
Iron content BulkIronContent PPM Real
Aromatics (Weight) BulkWtAromatics PCT Real
Paraffins (Weight) BulkWtParaffins PCT Real
Naphthenes (Weight) BulkWtNaphthenes PCT Real
Boiling point (Mean BulkMeanAvgBP TEMP Real
average)
Boiling point (Cubic BulkCubicAvgBP TEMP Real
average)
Boiling point (Molal BulkMolalAvgBP TEMP Real
average)
Net heating value BulkNetHeatingValue Real
Mercaptan Sulfur BulkMercaptanSulfur PCT Real
Total Reactive Sulfur BulkTotReactiveSulf PCT Real
Wong Closed Cup BulkFlashPointWCCup TEMP Real
Flash Point
Bulk Vapor properties, Class = SrBulkProp
Temperature VapTemp TEMP Real
Pressure VapPres PRES Real
Vapor mole fraction VapMoleFracOfTot Real
Mole flow rate VapMoleRate MRAT Real
Molar enthalpy VapEnthalpy ENTH Real
Molar entropy VapEntropy ENTR Real
146 Appendix B
Entropy LiqEntropy ENTR Real
Molecular weight LiqMwOfPhase Real
UOP K-value LiqUOPKvalue Real
Acentric factor LiqAccenFactor Real
Tc LiqCritTemp TABS Real
Pc LiqCritPres PABS Real
Vc LiqCritVolume LIQV Real
Cv LiqCV CP Real
Cp LiqCP CP Real
Cp/Cv Ratio LiqCPCVRatio Real
Z from density LiqCritZFactor Real
Liquid density, Actual LiqDensityAct LDEN Real
Liquid density, Standard LiqDensityStd LDEN Real
Normal boiling point, LiqNBPMole TEMP Real
molal composition
Normal boiling point, LiqNBPWt TEMP Real
weight composition
Normal boiling point, LiqNBPVol TEMP Real
Volume composition
Thermal conductivity LiqThermalCond COND Real
Viscosity LiqViscosity VISC Real
Surface tension LiqSurfTension SURF Real
True Vapor Pressure LiqTrueVapPres PRES Real
Reid Vapor Pressure LiqReidVapPresN Real
(API NAPHTHA)
Reid Vapor Pressure LiqReidVapPresC Real
(API CRUDE)
Reid Vapor Pressure LiqReidVapPres3 Real
(ASTM D323-73)
Reid Vapor Pressure LiqReidVapPres4 Real
(ASTM D323-94)
Reid Vapor Pressure LiqReidVapPres5 Real
(ASTM D4953-91)
Reid Vapor Pressure LiqReidVapPres6 Real
(ASTM D5191-91)
Reid Vapor Pressure LiqReidVapPres7 Real
(IDL Method)
Reid Vapor Pressure LiqReidVapPres8 Real
(ASTM D323-82)
Flash Point LiqFlashPoint TEMP Real
Gross Heating Value LiqGrossHeatValue HVAL Real
Lower Heating Value LiqLowerHeatValue HVAL Real
Gas Wobbe Index LiqWobbeIndex Real
Rate of flow of C2+ LiqC2Plus Real US Gallons/100 Std. FT3
Rate of flow of C3+ LiqC3Plus Real US Gallons/100 Std. FT3
pH Value LiqPH Real
Ionic Strength LiqIonicStrength Real
Dry Stream Total Properties, Class = SrDecProp
Temperature HCTotTemp TEMP Real
Pressure HCTotPres PRES Real
Mole fraction HCTotMoleFracOfTot Real
Mole flow rate HCTotMoleRate MRAT Real
Molar enthalpy HCTotEnthalpy ENTH Real
Molar entropy HCTotEntropy ENTR Real
Molecular weight HCTotMwOfPhase Real
148 Appendix B
Crictical temperature HCVapCritTemp TABS Real
Critical Pressure HCVapCritPres PRES Real
Critical Volume HCVapCritVolume VAPV Real
Critical Z HCVapCritZFactor Real
Density, Actual HCVapDensityAct VDEN Real
Density, standard HCVapDensityStd VDEN Real
Normal boiling point, HCVapNBPMole TEMP Real
molal composition
Normal boiling point, HCVapNBPWt TEMP Real
weight composition
Normal boiling point, HCVapNBPVol TEMP Real
Volume composition
Heat capacity, constant HCVapCP CP Real
pressure
Heat capacity, constant HCVapCV CP Real
volume
Cp/Cv ratio HCVapCPCVRatio Real
Viscosity HCVapViscosity VISC Real
Thermal conductivity HCVapThermalCond COND Real
Surface Tension HCVapSurfTension SURF Real
True Vapor Pressure HCVapTrueVapPres PRES Real
Reid Vapor Pressure HCVapReidVapPresN Real
(API NAPHTHA)
Reid Vapor Pressure HCVapReidVapPresC Real
(API CRUDE)
Reid Vapor Pressure HCVapReidVapPres3 Real
(ASTM D323-73)
Reid Vapor Pressure HCVapReidVapPres4 Real
(ASTM D323-94)
Reid Vapor Pressure HCVapReidVapPres5 Real
(ASTM D4953-91)
Reid Vapor Pressure HCVapReidVapPres6 Real
(ASTM D5191-91)
Reid Vapor Pressure HCVapReidVapPres7 Real
(IDL Method)
Flash Point HCVapFlashPoint TEMP Real
Gross Heating Value HCVapGrossHeatValue HVAL Real
Lower Heating Value HCVapLowerHeatValue HVAL Real
Gas Wobbe Index HCVapWobbeIndex Real
Rate of flow of C2+ HCVapC2Plus Real US Gallons/100 Std. FT3
Rate of flow of C3+ HCVapC3Plus Real US Gallons/100 Std. FT3
150 Appendix B
Cv DecWatCV CP Real
Cp/Cv Ratio DecWatCPCVRatio Real
z from density DecWatCritZFactor Real
Liquid density, Actual DecWatDensityAct DENS Real
Liquid density, DecWatDensityStd DENS Real
Standard
Normal boiling point, DecWatNBPMole TEMP Real
molal composition
Normal boiling point, DecWatNBPWt TEMP Real
weight composition
Normal boiling point, DecWatNBPVol TEMP Real
Volume composition
Thermal conductivity DecWatThermalCond COND Real
Viscosity DecWatViscosity VISC Real
Surface tension DecWatSurfTension SURF Real
True Vapor Pressure DecWatTrueVapPres PRES Real
Reid Vapor Pressure DecWatReidVapPresN Real
(API NAPHTHA)
Reid Vapor Pressure DecWatReidVapPresC Real
(API CRUDE)
Reid Vapor Pressure DecWatReidVapPres3 Real
(ASTM D323-73)
Reid Vapor Pressure DecWatReidVapPres4 Real
(ASTM D323-94)
Reid Vapor Pressure DecWatReidVapPres5 Real
(ASTM D4953-91)
Reid Vapor Pressure DecWatReidVapPres6 Real
(ASTM D5191-91)
Reid Vapor Pressure DecWatReidVapPres7 Real
(IDL Method)
Flash Point DecWatFlashPoint TEMP Real
Gross Heating Value DecWatGrossHeatValue HVAL Real
Lower Heating Value DecWatLowerHeatValue HVAL Real
Gas Wobbe Index DecWatWobbeIndex Real
Rate of flow of C2+ DecWatC2Plus Real US Gallons/100 Std. FT3
Rate of flow of C3+ DecWatC3Plus Real US Gallons/100 Std. FT3
pH Value DecWatPH Real
Ionic Strength DecWatIonicStrength Real
152 Appendix B
Table 4.1 Flash Unit Operation
Read an attribute: FlashObject.GetAttribute(AttributeName, Index)
Write an attribute: FlashObject.PutAttribute(AttributeName, Index)
154 Appendix B
Table 4.3 Valve Unit Operation
Read an attribute: ValveObject.GetAttribute(AttributeName, Index)
Write an attribute: ValveObject.PutAttribute(AttributeName, Index)
156 Appendix B
Table 4.5 Splitter Unit Operation
Read an attribute: SplitterObject.GetAttribute(AttributeName, Index)
Write an attribute: SplitterObject.PutAttribute(AttributeName, Index)
158 Appendix B
Table 4.6 Compressor Unit Operation
Read an attribute: CompressorObject.GetAttribute(AttributeName, Index)
Write an attribute: CompressorObject.PutAttribute(AttributeName, Index)
160 Appendix B
Table 4.6 Compressor Unit Operation
Read an attribute: CompressorObject.GetAttribute(AttributeName, Index)
Write an attribute: CompressorObject.PutAttribute(AttributeName, Index)
Calculated Properties
Compressor Conditions, Class = Compressor
Temperature TempCalc TEMP Real
Pressure PressCalc PRES Real
Pressure gain PressGainCalc PDIF Real
Pressure ratio PressRatioCalc Real
Actual volumetric flowrate ActVolVapFlow GVRA Real
at inlet
CV
- at inlet CVFrmAdiaFlshFd CP Real
- at outlet CVFrmAdiaFlshPrd CP Real
Compressibility Factor
- at inlet CompressFactIn Real
- at outlet CompressFactOut Real
Operating speed RPMCalc Real
Reference operating RefRPMCalc Real
speed
Fan Law exponent - eff EffExpoCalc Real
Fan Law exponent - head HeadExpoCalc Real
Efficiency
- adiabatic EffAdiaCalc Real
- polytropic EffPolyCalc Real
Head
- adiabatic AdiabaticHead LENG Real
- polytropic PolytropicHead LENG Real
- actual HeadCalc LENG Real
Work
- theoretical WorkTheoCalc WORK Real
- polytropic WorkPolyCalc WORK Real
- actual WorkActualCalc WORK Real
Isentropic coefficient, K IsenCoeffCalc Real
Polytropic coefficient, N PolyCoeffCalc Real
ASME "F" factor FValForAsmeOpt Real
Aftercooler
162 Appendix B
Table 4.7 Expander Unit Operation
Read an attribute: ExpanderObject.GetAttribute(AttributeName, Index)
Write an attribute: ExpanderObject.PutAttribute(AttributeName, Index)
164 Appendix B
Table 4.8 Pipe Unit Operation
Read an attribute: PipeObject.GetAttribute(AttributeName, Index)
Write an attribute: PipeObject.PutAttribute(value,AttributeName, Index)
166 Appendix B
Table 4.8 Pipe Unit Operation
Read an attribute: PipeObject.GetAttribute(AttributeName, Index)
Write an attribute: PipeObject.PutAttribute(value,AttributeName, Index)
168 Appendix B
Table 5.1 Column Unit Operation
Read an attribute: Value=ColumnObject.GetAttribute(AttributeName, Index)
Write an attribute: ColumnObject.PutAttribute(Value,AttributeName, Index)
170 Appendix B
Table 5.1 Column Unit Operation
Read an attribute: Value=ColumnObject.GetAttribute(AttributeName, Index)
Write an attribute: ColumnObject.PutAttribute(Value,AttributeName, Index)
172 Appendix B
Table 5.1 Column Unit Operation
Read an attribute: Value=ColumnObject.GetAttribute(AttributeName, Index)
Write an attribute: ColumnObject.PutAttribute(Value,AttributeName, Index)
174 Appendix B
Table 5.1 Column Unit Operation
Read an attribute: Value=ColumnObject.GetAttribute(AttributeName, Index)
Write an attribute: ColumnObject.PutAttribute(Value,AttributeName, Index)
176 Appendix B
Table 5.1 Column Unit Operation
Read an attribute: Value=ColumnObject.GetAttribute(AttributeName, Index)
Write an attribute: ColumnObject.PutAttribute(Value,AttributeName, Index)
178 Appendix B
Table 5.1 Column Unit Operation
Read an attribute: Value=ColumnObject.GetAttribute(AttributeName, Index)
Write an attribute: ColumnObject.PutAttribute(Value,AttributeName, Index)
180 Appendix B
Table 5.1 Column Unit Operation
Read an attribute: Value=ColumnObject.GetAttribute(AttributeName, Index)
Write an attribute: ColumnObject.PutAttribute(Value,AttributeName, Index)
182 Appendix B
Table 5.1 Column Unit Operation
Read an attribute: Value=ColumnObject.GetAttribute(AttributeName, Index)
Write an attribute: ColumnObject.PutAttribute(Value,AttributeName, Index)
184 Appendix B
Table 6.1 Simple Heat Exchanger Unit Operation
Read an attribute: Value=HXObject.GetAttribute(AttributeName, Index)
Write an attribute: HXObject.PutAttribute(Value,AttributeName, Index)
186 Appendix B
Table 6.1 Simple Heat Exchanger Unit Operation
Read an attribute: Value=HXObject.GetAttribute(AttributeName, Index)
Write an attribute: HXObject.PutAttribute(Value,AttributeName, Index)
188 Appendix B
Table 6.2 Rigorous Heat Exchanger Unit Operation
Read an attribute: Value=HXObject.GetAttribute(AttributeName, Index)
Write an attribute: HXObject.PutAttribute(Value,AttributeName, Index)
190 Appendix B
Table 6.2 Rigorous Heat Exchanger Unit Operation
Read an attribute: Value=HXObject.GetAttribute(AttributeName, Index)
Write an attribute: HXObject.PutAttribute(Value,AttributeName, Index)
192 Appendix B
Table 6.2 Rigorous Heat Exchanger Unit Operation
Read an attribute: Value=HXObject.GetAttribute(AttributeName, Index)
Write an attribute: HXObject.PutAttribute(Value,AttributeName, Index)
194 Appendix B
Table 6.2 Rigorous Heat Exchanger Unit Operation
Read an attribute: Value=HXObject.GetAttribute(AttributeName, Index)
Write an attribute: HXObject.PutAttribute(Value,AttributeName, Index)
196 Appendix B
Table 6.2 Rigorous Heat Exchanger Unit Operation
Read an attribute: Value=HXObject.GetAttribute(AttributeName, Index)
Write an attribute: HXObject.PutAttribute(Value,AttributeName, Index)
198 Appendix B
Table 6.3 LNG Heat Exchanger Unit Operation
Read an attribute: Value=HXObject.GetAttribute(AttributeName, Index)
Write an attribute: HXObject.PutAttribute(Value,AttributeName, Index)
200 Appendix B
Table 7.1 Plug Flow Reactor(PFR) Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
202 Appendix B
Table 7.1 Plug Flow Reactor(PFR) Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
204 Appendix B
Table 7.1 Plug Flow Reactor(PFR) Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
206 Appendix B
Table 8.1 Conversion Reactor Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
208 Appendix B
Table 8.1 Conversion Reactor Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
210 Appendix B
Table 8.2 Gibbs Reactor Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
212 Appendix B
Table 8.2 Gibbs Reactor Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
Calculated Properties
Operating Conditions, Class = Gibbs
Calculated reactor outlet OutPressCalc PRES Real
pressure
Calculated reactor PressDropCalc PDIF Real
pressure drop
Calculated Phase RXNPhaseFlagCalc Real
Phase type PhaseTypeVector 0 to Real NPH = Maximum no of
NPH - 1 fluid phases
1 – Vapor
2 - Liquid
Operating phase flag RXNPhaseFlagCalc InT
calculated
Guessed phase when GuessPhaseCalc InT
phase is unknown
(calculated)
Elimination criterion DropPhaseCalc Real
Of a fluid phase
Initial split ratio for phase PhaseSplitRatioEst Real
split trial
Reactor operation flag OperFlagCalc InT
calculated
Reactor temperature OutTempCalc TEMP Real
calculated
Allowed maximum MaxTempCalc TEMP Real
temperature calculated
Allowed minimum MIntempCalc TEMP Real
temperature calculated
Global Temperature GlobalTempApprCalc TDIF Real
Approach calculated
214 Appendix B
Table 8.2 Gibbs Reactor Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
Reactor Data,
Class = Gibbs
Unit ID UnitID Char
Maximum iteration MaxIterCalc InT
allowed
Iteration number before StartTrialCalc InT
Start of phase split trial
Frequency of phase split TrialFreqCalc InT
trial
Convergence tolerance ConvergeTolerCalc Real
Convergence tolerance FibboTolerCalc Real
for Fibonacci search
216 Appendix B
Table 8.2 Gibbs Reactor Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
218 Appendix B
Table 8.3 Equilibrium Reactor Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
220 Appendix B
Table 8.3 Equilibrium Reactor Unit Operation
Read an attribute: ReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: ReactorObject.PutAttribute(AttributeName, Index)
222 Appendix B
Table 9.1 Batch Distillation Unit Operation
Read an attribute: BatchDistil Object.GetAttribute(AttributeName, Index)
Write an attribute: BatchDistil Object.PutAttribute(AttributeName, Index)
Check for Heat media ReboilerSpecFlag InT Index: check for Heat
spec Vector media spec
224 Appendix B
Table 9.1 Batch Distillation Unit Operation
Read an attribute: BatchDistil Object.GetAttribute(AttributeName, Index)
Write an attribute: BatchDistil Object.PutAttribute(AttributeName, Index)
Pressure drop per column PressureDropPerColu PDIF Real pressure drop per
scalar column - Input
Trend graph flag TrendInterdataFlag InT Flag for creating file for
trend graph Intermittant
data
226 Appendix B
Table 9.1 Batch Distillation Unit Operation
Read an attribute: BatchDistil Object.GetAttribute(AttributeName, Index)
Write an attribute: BatchDistil Object.PutAttribute(AttributeName, Index)
228 Appendix B
Table 9.1 Batch Distillation Unit Operation
Read an attribute: BatchDistil Object.GetAttribute(AttributeName, Index)
Write an attribute: BatchDistil Object.PutAttribute(AttributeName, Index)
230 Appendix B
Table 9.1 Batch Distillation Unit Operation
Read an attribute: BatchDistil Object.GetAttribute(AttributeName, Index)
Write an attribute: BatchDistil Object.PutAttribute(AttributeName, Index)
Check for policy pressure PressTimeCheck InT Index: check for policy
time Vector pressure time
Check for policy pressure IndexSegPress InT Index: check for policy
Vector pressure
Start time for PRINT PrIntStartTime TIME Real start time for PRINT
scalar
End time for PRINT PrIntEndTime TIME Real end time for PRINT
scalar
232 Appendix B
Table 9.1 Batch Distillation Unit Operation
Read an attribute: BatchDistil Object.GetAttribute(AttributeName, Index)
Write an attribute: BatchDistil Object.PutAttribute(AttributeName, Index)
234 Appendix B
Table 10.1 Batch Reactor Unit Operation
Read an attribute: BatReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: BatReactorObject.PutAttribute(AttributeName, Index)
236 Appendix B
Table 10.1 Batch Reactor Unit Operation
Read an attribute: BatReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: BatReactorObject.PutAttribute(AttributeName, Index)
238 Appendix B
Table 10.1 Batch Reactor Unit Operation
Read an attribute: BatReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: BatReactorObject.PutAttribute(AttributeName, Index)
240 Appendix B
Table 10.1 Batch Reactor Unit Operation
Read an attribute: BatReactorObject.GetAttribute(AttributeName, Index)
Write an attribute: BatReactorObject.PutAttribute(AttributeName, Index)
242 Appendix B
Table 11. 1 Depressure Unit Operation
Read an attribute: Depressure Object.GetAttribute(AttributeName, Index)
Write an attribute: Depressure Object.PutAttribute(AttributeName, Index)
Fire wetted area FireWetArea AREA Real Input fire wetted area
244 Appendix B
Table 11. 1 Depressure Unit Operation
Read an attribute: Depressure Object.GetAttribute(AttributeName, Index)
Write an attribute: Depressure Object.PutAttribute(AttributeName, Index)
Fire wetted area factor FireWetAreaFac Real Input fire wetted area
factor
Heat transfer area HeatTranArea AREA Real Input gas blowdown
heat transfer area
Heat transfer area factor HeatTranAreaFact Real Input gas blowdown
heat transfer area
factor
Gas blowdown liquid HTC LiquidHTC HTCO Real Input gas blowdown
liquid htc
Heat model B coefficient HeatModelCoefB Real input user heat model
B coefficient
Heat model D coefficient HeatModelCoefD Real input user heat model
D coefficient
Heat model E coefficient HeatModelCoefE Real input user heat model
E coefficient
Duty Duty DUTY Real Input duty
246 Appendix B
Table 11. 1 Depressure Unit Operation
Read an attribute: Depressure Object.GetAttribute(AttributeName, Index)
Write an attribute: Depressure Object.PutAttribute(AttributeName, Index)