Sie sind auf Seite 1von 14

Managing PSS®E 30 and 31 on the Same Computer

PSS®E version 30 and version 31 can both be installed on the same computer and they will coexist
without interfering with each other (version 30 means any 30.x.x release).

However, there are some management issues that exist for users in one or both of the following
situations:

a. Those who need to compile and link user-written Dynamics models and/or Connection rou-
tines (i.e., CONEC and CONET), and to be able to do this for both versions, switching
between them from time to time.1

b. Those who intend to run PSS®E from the Python interpreters outside of the PSS®E GUI
environment, and to be able to do this for both versions, switching between them from time
to time.

To compile user-written Dynamics models and/or Connection routines and link a Dynamics User
Library you must use the same compiler(s) as the version of PSS®E that they are to be used with.
Version 30 and version 31 use different Fortran and C compilers (both run-time environments are
referenced, even if only Fortran code is used).2 In order to select the correct compiler versions the
Windows environment variables PATH and LIB need to be set appropriately.

Additionally, when running PSS®E from Python interpreters outside of PSS®E GUI environment,
the Python interpreter executables need to be activated with a PSS®E version specific activation
code.

Both of these issues can be managed using the PSS®E Version Management program described
in Section 1 below. A description of manual processes for managing the two issues are described
in Section 2 below, should you prefer it.

To use the PSS®E Version Management program, download the self-installing exe file for “PSS®E
Version Management” from PSS®E User Support Web page and install it. The installer will:

• Install the PSS®E Version Management program and user guide in the
C:\Program Files\PTI\PSSEVMgmt folder.
• Add a “PSSEVMgmt” desktop icon
• Add menu item Start >Programs >PSSE Version Management >Run
• Add menu item Start >Programs >PSSE Version Management >User Guide

1 This issue does not apply to users who have installed the 30.3.3 release built with the IVF compiler. PSS®E 30.3.3 is
available in both compiled forms.
2 If your source code is in FLECS, all the Fortran comments apply; FLECS is a pre-processor that generates Fortran
code, which is then compiled using the Fortran compiler.

Siemens Power Transmission & Distribution, Inc., Power Technologies International 1


Managing PSS®E 30 and 31 on the Same Computer

1 PSS®E Version Management Program


This program requires Python 2.5.1, Win 32 extensions for Python 2.5, Build 210, and
wxPython 2.8.4 or later to run.
This program searches the installation location for following programs.
- Microsoft Visual Studio 2005 and/or Microsoft Visual Studio Express 2005
- Microsoft Visual Studio 1998
- Intel Visual Fortran Compiler 9.1, 10.1.xxx. If more than one compiler is installed, the
program will select the latest compiler.
- Compaq Visual Fortran Compiler 6.6B
If these programs are found, then PATH/LIB variables are updated as per their installation loca-
tion. If any of these programs are not installed, then correspoding PATH/LIB settings are
ignored.
Use “Show Defaults” button to see/verify the PATH/LIB defaults used.
Use “Modify PATH/LIB DIR Names” button to manually add/modify the PATH/LIB settings.
The defaults used for python interpreter executable names are python.exe and pythonw.exe.
Use “Modify Python Exe Names” button to add any other interpreter executable.

1. Select the appropriate PSS®E version.

2. Click [Update] to update the settings.

2 Siemens Power Transmission & Distribution, Inc., Power Technologies International


Managing PSS®E 30 and 31 on the Same Computer

Siemens Power Transmission & Distribution, Inc., Power Technologies International 3


Managing PSS®E 30 and 31 on the Same Computer

4 Siemens Power Transmission & Distribution, Inc., Power Technologies International


Managing PSS®E 30 and 31 on the Same Computer

Siemens Power Transmission & Distribution, Inc., Power Technologies International 5


Managing PSS®E 30 and 31 on the Same Computer

2 Managing PSS®E Version Manually


The user needs to implement following two steps to ensure that the environment is set up properly.

• Controlling the version of Python and the version of PSS®E used to run a Python script out-
side of PSS®E’s GUI (see Section 2.1 below).
• Select the proper environment to compile Connection Routines and User Models, and to
link a Dynamics User Library (see Section 2.2 below).

2.1 Controlling the version of Python and PSS®E


PSS®E version 31 requires Python version 2.5.x. Modules and compiled Python files
supplied with PSS®E version 31 can only be used with Python 2.5.x.
PSS®E version 30 requires Python version 2.3.x. Modules and compiled Python files
supplied with PSS®E version 30 can only be used with Python 2.3.x.
The PSS®E GUI will automatically use the correct version, if installed properly.
When running Python scripts outside of the PSS®E GUI that use PSS®E functions, there
are three concerns that must be managed by the user. They are the following:
• Selecting the correct version of Python to execute
• Setting the security code for Python to use PSS®E
• Finding the PSS®E extension module and engine library from Python

2.1.1 Selecting the correct version of Python to execute


There are a couple of ways to handle this. We will outline one way that we have had good
experience with.
Firstly, note that when Python 2.3.x is installed, the standard installation path is
C:\Python23. We will assume that path in the rest of this section.
Similarly, when Python 2.5.x is installed, the standard installation path is C:\Python25.
We will assume that path in the rest of this section.
Take the following steps:
A. Check your PATH environment variable values. Here are two ways to do this:

(i) Start --> Settings --> Control Panel (ii) Select Properties from the context menu of
the desktop icon “My Computer”
Open System (double click)
Select Properties
Select tab Advanced
Select tab Advanced
Click button Environment Variables
Click button Environment Variables

This will open following dialog.

6 Siemens Power Transmission & Distribution, Inc., Power Technologies International


Managing PSS®E 30 and 31 on the Same Computer

B. If the System PATH variable contains C:\Python23 and/or C:\ Python25, remove
them.

C. Create two new User variables PATH_PY25 and PATH_PY23 as below.

D. Click the ‘New’ button in the ‘User variables’ section of the ‘Environment Variables’
dialog opened in (A). This opens the following dialog. Set these variables with appro-
priate values as shown below.

Siemens Power Transmission & Distribution, Inc., Power Technologies International 7


Managing PSS®E 30 and 31 on the Same Computer

E. Create new or edit User variable PATH. If you already have a User variable PATH,
check for, and remove, references to the installed Python paths as we did for the
System PATH variable in (B) above. Add the variable PATH_PY25 or PATH_PY23 to
the User PATH variable, as shown below (either one, for now – but NOT both).

or

The steps (B), (C), and (D) above are needed only once. If you selected to add the vari-
able PATH_PY25 in (E) above, you are set up to run Python 2.5. If you selected to add
the variable PATH_PY23 in (E) above, you are set up to run Python 2.3. To change
between them, edit the User PATH variable as shown above and change PATH_PY25 to
PATH_PY23 or vice versa.
Be aware that changing environment variables does not affect running processes. For
example: if you open a Command Prompt and then change PATH_PY25 to PATH_PY23
as described above, and then run python, you will run Python 2.5 because that process
retains the value of PATH at the time that it started. If you now open another Command
Prompt and run python you will run Python 2.3.
In the examples in (E) above the variables we have been discussing are shown following
another variable specification. All elements in path lists, whether fixed paths or other
environment variables, are separated by semi-colons. The particular values shown here
are not random, but are related to this discussion. See Section 2.2.

2.1.2 Setting the security code for Python to use PSS®E


With each PSS®E installation you are given an activation string. This is used to activate
your license to use that version of PSS®E on that computer; the details are handled by
the installation script. If you need to you can “activate” other programs that use the
PSS®E engine via a program installed with PSS®E called ACTV. Before PSS®E release
30.0.0 this was an extremely rare circumstance.

8 Siemens Power Transmission & Distribution, Inc., Power Technologies International


Managing PSS®E 30 and 31 on the Same Computer

When you run Python outside of the PSS®E GUI the program you are actually executing
is either python.exe or pythonw.exe. The PSS®E installer “activates” both of these pro-
grams. However the activation process only uses the name of the program, not the loca-
tion, version, or any other identifying characteristic to differentiate between two programs
with the same name. Since the executable files python.exe and pythonw.exe are the
same for Python 2.3 and 2.5 this means that each can only be “activated” for one version
of PSS®E at a time.
In an environment where both versions 30 and 31 of PSS®E are installed you may need
to change the activation of the Python executable files. One straightforward way of
achieving this is as follows:
A. Create two batch files, actvpy30.bat and actvpy31.bat, as follows:
• Contents of actvpy30.bat:

C:\PROGRA~1\PTI\PSSE30\PSSBIN\ACTV PUT_YOUR_V30_CODE_HERE PYTHON.EXE


C:\PROGRA~1\PTI\PSSE30\PSSBIN\ACTV PUT_YOUR_V30_CODE_HERE PYTHONW.EXE

• Contents of actvpy31.bat:

C:\PROGRA~1\PTI\PSSE31\PSSBIN\ACTV PUT_YOUR_V31_CODE_HERE PYTHON.EXE


C:\PROGRA~1\PTI\PSSE31\PSSBIN\ACTV PUT_YOUR_V31_CODE_HERE PYTHONW.EXE

Where:
• If you use any other Python executables (like pythonwin.exe), add those to this list.
• C:\PROGRA~1\PTI\PSSE30\PSSBIN is the PSS®E 30 installation path. If your
installation path is different, modify accordingly.
• C:\PROGRA~1\PTI\PSSE31\PSSBIN is the PSS®E 31 installation path. If your
installation path is different, modify accordingly.
• PUT_YOUR_V30_CODE_HERE and PUT_YOUR_V31_CODE_HERE are your activa-
tion strings. Substitute you actual activation strings in the code above.

B. Keep these files in a folder which is on your windows PATH, so that it can be accessed
from any folder. For example, C:\WINNT on Windows XP machines.

These steps are needed only once. Afterwards, if you are currently using, say, version
31 and want to switch to version 30, run actvpy30.bat. Following are two ways to do this:
• From any Command prompt window, run actvpy30.bat, from any location. The fol-
lowing example assumes you are located at the root directory of the C: drive:

C:\>actvpy30

• Start > Run > actvpy30


If you are currently using version 30 and want to switch to version 31, run actvpy31.bat.

Siemens Power Transmission & Distribution, Inc., Power Technologies International 9


Managing PSS®E 30 and 31 on the Same Computer

2.1.3 Finding the PSS®E extension module and engine library from Python
Python searches for extension modules according to the paths included in the import path
list. This list can be examined in a Python program in sys.path. The initial setting of the
values in that list is beyond the scope of this document. Python modules may be in one
of several forms, including Python source, compiled Python code, and dynamic-link-
libraries. If a Python module is implemented as a dynamic-link-library, then it may in turn
be linked to other libraries. Those libraries will use the standard Windows load search
path, which is different than the import search path used by Python.
Both of these search paths use environment variables to set up part of the directory lists.
PYTHONPATH is used for the Python module search path, and PATH is used by the Win-
dows loader.
The list in sys.path can be manipulated by a running program, and the PATH environment
variable can also be changed by a running program (changing PYTHONPATH in a run-
ning program will not be helpful, since it is only used to initialize sys.path). Eaxmples of
this technique can be found in Chapter 12 of the Users Manual.
Both the Python extension modules and the libraries supplied with PSS®E will be located
in the PSSBIN directory of your PSS®E installation. This directory will need to be located
on both the Python import path list and the Windows load search path.

2.2 Compiling and linking a Dynamics User Library


PSS®E version 31 requires Microsoft Visual C/C++ version 8 (the version of the compiler
supplied with the product Microsoft Visual Studio 2005) and Intel Visual FORTRAN com-
piler version 9.1/10.1.xxx. The linker supplied with Microsoft Visual Studio 2005 is
version 8.
PSS®E version 30 (and 29) requires Compaq Visual FORTRAN compiler version 6.6B.
It was built also using Microsoft Visual C/C++ version 6 (part of the 1998 version of Visual
Studio). The corresponding linker version is 6.
When compiling and linking programs to be used with PSS®E, such as Connection Rou-
tines or User Written Models, the same compiler and linker must be used as was used to
build the product.

2.2.1 How to create a Dynamics User Library


Compilation of Connection Routines and User Models is usually done using a compile
batch file, which can be generated by the PSS®E activity DYRE (or the Compile file from
File>Open, *.dyr in the GUI).
The link is usually done using the CLOAD4 batch file, creating a library named
DSUSR.DLL.
At version 31 a new method to do both is also supplied; from the Start menu select
Start>Programs>PSS®E 31>Create usrdll.
None of these methods can control completely which version of the compilers and linkers
listed in the section above is being used, if both sets are installed.

10 Siemens Power Transmission & Distribution, Inc., Power Technologies International


Managing PSS®E 30 and 31 on the Same Computer

2.2.2 Selecting the correct version of compiler and linker to execute


The easiest way to be sure that the right one is being used is to manipulate the PATH and
LIB environment variables
When Visual Studio 2005 and the IVF compiler are installed, windows SYSTEM variables
PATH and LIB are set by their installation. Typically the PATH and LIB values correspond-
ing to these programs are:

LIB: "C:\Program Files\Microsoft Visual Studio 8\VC\lib"


"C:\Program Files\Intel\Compiler\Fortran\9.1\IA32\Lib"
PATH: "C:\Program Files\Intel\Compiler\Fortran\9.1\IA32\Bin"
"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE"
"C:\Program Files\Microsoft Visual Studio 8\Common7\Tools"
"C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin"
"C:\Program Files\Microsoft Visual Studio 8\VC\BIN"
"C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin"
"C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages"
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin"
"C:\WINNT\Microsoft.NET\Framework\v2.0.50727"

Similarly, when Visual Studio (1998) and the CVF compiler are installed, windows SYS-
TEM variables PATH and LIB are set by their installation. Typically the PATH and LIB val-
ues corresponding to these programs are:

LIB: "C:\Program Files\Microsoft Visual Studio\DF98\LIB"


"C:\Program Files\Microsoft Visual Studio\VC98\LIB"
PATH: "C:\Program Files\Microsoft Visual Studio\Common\Tools"
"C:\Program Files\Microsoft Visual Studio\Common\Msdev98\BIN"
"C:\Program Files\Microsoft Visual Studio\DF98\BIN"
"C:\Program Files\Microsoft Visual Studio\VC98\BIN"

Take the following steps:


A. Check your PATH environment variable values. Here are two ways to do this:

(i) Start --> Settings --> Control Panel (ii) Select Properties from the context menu of
the desktop icon “My Computer”
Open System (double click)
Select Properties
Select tab Advanced
Select tab Advanced
Click button Environment Variables
Click button Environment Variables

This will open following dialog.

Siemens Power Transmission & Distribution, Inc., Power Technologies International 11


Managing PSS®E 30 and 31 on the Same Computer

B. Check values of the PATH and LIB variables in "System variables" section. You may
want to copy these values to a file using a text editor to make the following steps a
little easier.

If the LIB and PATH variables have any of the paths described above, they need to
be removed from here and set as "User variables", as described in (C), below. If these
paths are not present you will have to search your system for the installation paths of
the Visual Studio, CVF, Visual Studio 2005 and IVF programs in your computer.

C. Create new User variables LIB_IVF, PATH_IVF, LIB_CVF, and PATH_CVF as shown
below.

Click the ‘New’ button in the ‘User variables’ section of the ‘Environment Variables’
dialog opened in (A). This opens the following dialog. Set these variables with appro-
priate values obtained in (B). Their typical values are provided below.

12 Siemens Power Transmission & Distribution, Inc., Power Technologies International


Managing PSS®E 30 and 31 on the Same Computer

LIB_IVF:
"C:\Program Files\Microsoft Visual Studio 8\VC\lib"
"C:\Program Files\Intel\Compiler\Fortran\9.1\IA32\Lib"
PATH_IVF:
"C:\Program Files\Intel\Compiler\Fortran\9.1\IA32\Bin"
"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE"
"C:\Program Files\Microsoft Visual Studio 8\Common7\Tools"
"C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin"
"C:\Program Files\Microsoft Visual Studio 8\VC\BIN"
"C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin"
"C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages"
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin"
"C:\WINNT\Microsoft.NET\Framework\v2.0.50727"
LIB_CVF:
"C:\Program Files\Microsoft Visual Studio\DF98\LIB"
"C:\Program Files\Microsoft Visual Studio\VC98\LIB"
PATH_CVF:
"C:\Program Files\Microsoft Visual Studio\Common\Tools"
"C:\Program Files\Microsoft Visual Studio\Common\Msdev98\BIN"
"C:\Program Files\Microsoft Visual Studio\DF98\BIN"
"C:\Program Files\Microsoft Visual Studio\VC98\BIN"

D. Create new ‘User variables’ LIB and PATH as below to set LIB and PATH corre-
sponding to PSS®E version 31.

Siemens Power Transmission & Distribution, Inc., Power Technologies International 13


Managing PSS®E 30 and 31 on the Same Computer

Steps (A) through (C) are needed only once. If you entered the LIB_IVF and PATH_IVF
variables as shown above, then you are set up to run the IVF compiler and version 8 of
the MS compiler and linker. If you entered instead the LIB_CVF and LIB_IVF variables,
then you are set up to run the CVF compiler and version 6 of the MS compiler and linker.
To change between them, edit the User PATH and LIB variables as shown above and
change IVF part of the name to CVF or vice versa.
Be aware that changing environment variables does not affect running processes. For
example: if you open a Command Prompt and then change PATH_PY25 to PATH_PY23
as described above, and then run python, you will run Python 2.5 because that process
retains the value of PATH at the time that it started. If you now open another Command
Prompt and run python you will run Python
In the exact examples shown in (D) above only the single variable value is entered. Mul-
tiple values of variables and/or path names are allowed, separated by semi-colons.

14 Siemens Power Transmission & Distribution, Inc., Power Technologies International

Das könnte Ihnen auch gefallen