Difference between revisions of "OLI Engine 9.3"

From wiki.olisystems.com
Jump to: navigation, search
Line 1: Line 1:
Revision Date August 16, 2016
+
'''Revision Date August 16, 2016'''
  
  

Revision as of 12:10, 23 August 2016

Revision Date August 16, 2016


OLI Engine 9.3 is a collection of Windows dynamic link libraries (DLLs) that a software developer can use to integrate OLI’s phase and chemical equilibrium calculation capabilities into custom solutions and products. This manual is intended to show you how to use the OLI Engine DLLs in your own development projects.




1 Installation

The installation script is available in two forms:

  • Self-extracting executable file named “OLI Engine 8.2.x.exe” available for download from the

OLI Systems web site.

  • Product distribution CD available from OLI Systems.

'1.1 Requirements'


1.1.1 Hardware

OLI 9.3 image 1.jpg


== 1.1.2 Operating System ==


The following table shows the versions of Windows that are supported and the preferred service pack level for each.

OLI 9.3 image 2.jpg


Also, if possible, it is advisable to upgrade to Internet Explorer 7.0 or later. This has the side-benefit of making sure that your Windows system has the latest support DLLs for Microsoft’s COM subsystem.


1.1.3 Software

Before using this product, you will need to have a dbs file. You can create dbs files using “OLI Chemistry Wizard 3.0 or later”.


Also, to develop applications to use the Engine you will need one or more of the following development environments: Microsoft Visual Studio .NET 2003 Intel Fortran 8.0 or later.


1.2 OLI Hardlock Key

You will need an OLI Systems Hardlock security key and associated serial number. If you downloaded this package from the OLI Systems web site then you will need to contact OLI Systems to request that a key and serial number package be sent to you.


To install the Hardlock key, simply attach it to the parallel port located on the back of your computer. If you have the USB version of the Hardlock key then attach it to any available USB connection.


If you have a parallel port version of the Hardlock key and you have a printer connected to the parallel port, then unplug your printer, connect the key and then reconnect your printer to the Hardlock key. The Hardlock key shouldn’t interfere with your printer.


Also, if you have a parallel port security key for another software product, please make sure that the OLI Hardlock key is connected directly to the parallel port and is first in the chain of keys. The Hardlock key seems to be sensitive to port power levels and works best when it is connected directly to the parallel port.


1.3 Setup

The OLI Engine installation uses a Microsoft Windows based Installer to lead you through a typical installation process. The installation is provided as a single file based install.

  • The file is named “OLI Engine 8.2.x.exe” ans is available for download from the OLI Systems

web site.

  • A product distribution CD is also available from OLI Systems.


During the installation, you will be asked to provide your name, organization and a product serial number.


1.4 Verification

You can verify your installation by simply making sure that files were installed to the desired installation directory and that a program group has been added to the Start menu.

Open Windows Explorer and navigate to the destination directory:

C:\Program Files\OLI Systems\OLI Engine 8.2

or

C:\Program Files (x86)\OLI Systems\OLI Engine 8.2 on 64 bit systems

You should find these sub folders:

bin

doc

include

lib

samples

Next, click on the ‘Start’ button and navigate to:

Programs\OLI Systems\OLI Engine 8.2\Tools

You should see a menu item for ‘Security Settings and Test’.

2 A Quick Start -- TestEqSolve

An application that demonstrates how to use the OLI Engine has been provided. This application named TestEqSolve takes a single command line argument specifying an OLI chemistry model file (.mod) or a chemistry model database file (.dbs).

Given a model file, TestEqSolve uses the functions provided in OLIGenerate.dll to generate a model database (.dbs) file.

Given a chemistry model database (.dbs) file, the program uses the functions provided by OLIEngine.dll to load the database, retrieve model information and perform an equilibrium calculation.

Two sets of project files have been copied to the ‘src’ directory; one set each for the Intel Fortran Compiler 8.0 and the Intel Fortran 11.0 compiler.

2.1 Intel Fortran 8.0 or 11.0 Projects

The solution and project files for the Intel Fortran compiler are located in:

C:\Program Files\OLI Systems\OLI Engine 8.2\src\TestEqSolve\Intel80

or

C:\Program Files\OLI Systems\OLI Engine 8.2\src\TestEqSolve\Intel11

Open the TestEqSolve.sln solution file in Visual Studio .NET 2003.

You may need to copy the contents of the src folder to a writable folder on your system. Starting with Windows Vista the Program Files folder has become a read only location.

You should be able to simply build the application for both Debug and Release builds.

For now, build the TestEqSolve Debug project. Next, modify the Debug session settings in the Project Settings:

Working Directory: C:\Program Files\OLI Systems\OLI Engine 8.2\Samples\Test

Command Arguments: NaClAq1.mod NaClAq1.inp NaClAq1.out

OLI 9.3 image 3.jpg

Run the application. A console window should appear and the text shown in Listing 1 should be generated.

If you receive a message saying OLIEngine.dll not found when running the application the engine’s location was not included into your path. Modify you path to include `C:\Program Files\OLI Systems\OLI Engine 8.2\bin` and then restart the development environment.

In Solution Explorer, open and review TestEqSolve.for (also listed in Appendix 1). The most important detail to remember is to use the include statement to include ‘OLIEngine.fi’ in any subroutine or function that is going to call a member of the OLIGenerate or OLIEngine libraries. ‘OLIEngine.fi’ includes interface definitions that explicitly declare the calling conventions used by the DLLs. Also be sure to specify the location of the include file in the proect settings. This can be done using the OLI_ENGINE_INSTALL_DIR environment variable that was created during the install. Ex: $(OLI_ENGINE_INSTALL_DIR)\include


3. Details

OLI Engine 8.2 consists of two dynamic link libraries: OLIEngine.dll and OLIGenerate.dll.

These DLLs consist of C and Fortran functions compiled using the Microsoft Visual Studio .NET 2003 C/C++ compiler and the Intel Fortran 8.0 compiler. All Fortran functions and subroutines have been using the CDECL calling convention and the no mixed string length convention.

The libraries are linked for multi-threaded use and they depend upon multi-threaded operating system DLLs. All of the DLLs that are required and are not normally included with Windows are included in the ‘bin’ subdirectory.

OLIEngine.dll is the main run-time DLL that included the equilibrium calculation and physical property functions. The following functions are exported by this DLL:

OLI 9.3 image 4.jpg

OLIGenerate.dll is used when you want to generate chemistry model database (.dbs) files given a model description (.mod) file. The following functions are exported:

OLI 9.3 image 5.jpg

All of these functions exported by OLIEngine.dll and OLIGenerate.dll are described in the “OLI Engine 8.2 Reference Manual” document.

The DLLs can be linked explicitly or dynamically loaded by name at run-time.


3.1 Intel Fortran 8.0/11.0 Project Settings

In order to use the OLI Engine DLLs in your own application, you will need to use the following project settings:

OLI 9.3 image 6.jpg

Also, make sure that you include ‘OLIEngine.fi’ in any subroutine that calls a function in either the OLIEngine.dll or the OLIGenerate.dll.