Creating Dynamics User Model Dynamic Linked Library (DLL) For Various PSS E Versions
Creating Dynamics User Model Dynamic Linked Library (DLL) For Various PSS E Versions
Creating Dynamics User Model Dynamic Linked Library (DLL) For Various PSS E Versions
General
PSS®E users, in addition to using the vast array of time tested library of dynamic models, can also write
their own models in high-level language like FORTRAN or FLECS. For PSS®E to recognize such user-
written models, the models written in FORTRAN or FLECS have to be compiled and a dynamic linked
library (DLL) created using the compiled code.
This article discusses the following aspects pertaining to creating user model static library (LIB) and
dynamic linked library (DLL) files:
Static LIB file or dynamic DLL files – which one should the user use
Compiler and Visual Studio software requirements for creating LIB and DLL files of PSS®E user-
written models
Use of Environment Manager (EM) for creating LIB and the DLL files
Software Requirements
To compile and link user-written models, the appropriate Fortran compiler and Microsoft Visual Studio
(C/C++) are needed.
The compiler and linker used in various PSS®E versions are as given below.
1. Version 33: Intel Visual Fortran Compiler version 12.0 and Microsoft Visual Studio 2010 (C/C++
compiler and linker version 10)
2. Version 32: Intel Visual Fortran Compiler version 10.1.024 and Microsoft Visual Studio 2008 (C/C++
compiler and linker version 9)
3. Version 31 and Version 30.3.3 IVF: Intel Visual Fortran Compiler version 9.1 and Microsoft Visual
Studio 2005 (C/C++ compiler and linker version 8)
4. Version 30 and previous versions: Compaq Visual Fortran Compiler version 6.6B and Microsoft
Visual Studio 1998 (C/C++ compiler and linker version 6)
Although the compiler and linker versions specified above were used for the various PSS®E releases,
from a users point of view they can use any of the Fortran compiler and Microsoft Visual Studio versions
as indicated below.
1. For Versions 33, 32, 31 and 30.3.3 IVF compile and link works well with –
Intel Visual Fortran (IVF) Compiler 9.1 or later
Microsoft Visual Studio 2005 or later
2. For Version 30 and previous versions compile and link works well with –
CVF 6.6B
Microsoft Visual Studio 1998
Microsoft Visual Studio comes in three different versions, any of which can be used for creating the DLL
in PSS®E
1. Microsoft Visual Studio Express Edition
2. Microsoft Visual Studio Premier Partner Edition (VSPPE)
3. Microsoft Visual Studio Professional
It is to be noted that the Microsoft Visual Studio is available for Visual Basic as well; however, this cannot
be used in PSS®E for creating the DLL.
PSS®E Environment Manager (EM)
The Environment Manager (EM) is a versatile tool that can be used to do the following:
1. Compile user-written models
2. Create static library (LIB) files
3. Create dynamic linked library (DLL) files
4. Set up the environment variables required to run specific PSS®E versions
The EM tool requires Python version 2.5 or 2.7. It is to be noted that the EM is independent of the PSS®E
version. Although the EM is provided as part of PSS®E installation, since the EM is subject to updates to
meet the wide requirements of our users, it is advisable to download the latest version of EM from the
PSS®E user support web page https://www.pti-us.com/pti/software/psse/user_support.cfm.
When using the EM to compile and link, it is not required to update Windows Environment variables
PATH and LIB. Instead these variables are updated temporarily by the EM and used as needed. This
avoids the user from making modifications to Windows registry leading to possible permission conflicts.
The EM can be used from:
Graphical User Interface (GUI)
Python script
For details, the user is referred to the EM guide that is provided as part of the EM installation.
Page 2
Power Technology March 2012
The GUI and progress message window when creating DLL for PSS®E version 33, and GUI window when
creating LIB for PSS®E version 32 are shown below.
Page 3
Power Technology March 2012
Page 4
Power Technology March 2012
Page 5