0% found this document useful (0 votes)
19 views2 pages

Resolve - OpenServer Overview

Uploaded by

ehsansafari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

Resolve - OpenServer Overview

Uploaded by

ehsansafari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Overview Page 1 of 2

User Guide > Appendix > Further Technical Elements - OpenServer > Overview

Up Previous Next

OpenServer Overview

OpenServer is the mechanism by which external applications can interact and control all the
programs in the IPM suite (PROSPER, GAP, REVEAL, PVTP, MBAL, and RESOLVE)

For example a VBA macro in Excel can be used to open, interrogate, and run IPM programs.

The OpenServer functionality that is in RESOLVE operates on the same principles as other
programs.

For more information, see the OpenServer manual that is distributed with the IPM suite.

There follows a brief overview of the functionality of the OpenServer with specific reference
to RESOLVE.

External OpenServer macros can be written to control RESOLVE. These macros can be
written in any language that supports automation, for example: Visual Basic, VBA, VBScript,
C++, Java, Matlab.

Most typically they are written as VBA macros in an Excel spreadsheet; the "OpenServer
example macros" are in this form. An OpenServer macro can call three different functions /
subroutines on the program (RESOLVE) it is controlling.

These are:
· retval = DoGet("tagstring") : interrogates a variable in the application (for example,
the schedule start date).
· DoSet("tagstring", "value") : sets a variable to the value "value".
· DoCmd("tagstring") : performs a command (for example, load a file, perform a run).

In each case, tagstring is a "." delimited string that refers to the variable or command in
question.

For example, to get the start date in RESOLVE, the following string will be used:

retval = DoGet("Resolve.Schedule.StartDate.DateStr")

will return the date in the form of dd/mm/yy (depending on the international settings).

To execute a prediction run, use:

DoCmd("Resolve.Run"),

and so on.

In each case the tagstring starts with the application name (in this case, RESOLVE).

When getting or setting a variable, the rest of the string is a delimited list of child variables
until we get to the required variable (DateStr is a "child" variable of the "StartDate" property,

mk:@MSITStore:D:\Petroleum%20Experts\IPM%2010\resolve.chm::/open_server__overv... 1/14/2024
Overview Page 2 of 2

which is a child of the Schedule data, and so on).


RESOLVE supported OpenServer variables are documented in the "Module Variables"
section.

When executing a command, the string simply refers to the command to be executed: these
are documented in the "Commands" section.

There is a quick way to find an OpenServer tagstring if the variable is part of the user
interface.
In this case, go to the required screen and press <Ctrl> and Right Click over the variable in
question.
A screen will appear with the variable tagstring which can then be copied to the clipboard.

Hysys and the OpenServer


Ü The Hysys driver supports the use of the OpenServer (see the "Module variables"
section for further details).
In versions 3.1 and later of Hysys, the Hysys application by default pops up a message
box whenever a file is loaded.
This obviously halts OpenServer - the macro cannot continue until this message box
has been cleared.
To remove the message box, from the Hysys application go to Tools | Preferences |
Simulation Page and uncheck the item: "Confirm before adding if active correlations
are present" under "Stream property correlations".
In fact, the preferences should be set to avoid pop up windows that may interrupt the
OpenServer operation

Note on the use of dates


Ü When a date property is returned it is returned in the form of the number of days since
01/01/1900. This can be useful to perform arithmetic calculations on dates
(differences, etc). To return a calendar date, append the string ".DateStr" (as above) to
the tagstring

Empty variables
Ü Variables that are not set (or are blank) in RESOLVE return a large number (3.4e34)
when the OpenServer queries them

Testing OpenServer commands


A very convenient tool exists to do immediate tests of OpenServer tag strings. It can be
located under the Wizards menu: Wizards | Execute Openserver command.

mk:@MSITStore:D:\Petroleum%20Experts\IPM%2010\resolve.chm::/open_server__overv... 1/14/2024

You might also like