Getting Started With OpenDSS
Getting Started With OpenDSS
http://smartgrid.epri.com/SimulationTool.aspx
Downloads
The Installer for the latest official release may be found at this link
http://sourceforge.net/projects/electricdss/files/
Download both the OpenDSS Installer file and any other files of interest on the download page.
Release version installers are posted at irregular intervals. If you have a Delphi compiler, up-to-
date versions may be built from the source code, which contains the latest changes. If you don't
have a compiler that can build the program, the latest beta builds are posted at these locations:
The latest build is generally just fine and you may need it to access the latest features reported in
the Wiki. However, there is a small risk some bug has crept into the code as changes were made.
Report any problems as soon as possible.
The Files
Presently, there are 5 program files:
Instead of using the Installer, you may simply copy these files to a directory (folder) of your choice.
The Installer will automatically register the COM server DLL. If you choose manual installation, and
wish to access the COM server, you will have to register the server yourself (see below).
It is recommended that you first use the Installer to make the initial installation. Thereafter, you may
update your version(s) of OpenDSS simply by overwriting OpenDSS.EXE and
OpenDSSEngine.DLL with the newer version from the beta build sites above.
The Installer will automatically do this step during installation. If you have used the Installer, you
may skip this step.
Registering is accomplished by issuing the following command to the DOS (Command) prompt
C:\OpenDSS>regsvr32 opendssengine.DLL
Assuming you did everything right, you should get a message that says the registration succeeded.
If you start up the Windows RegEdit tool, you should be able to find "OpenDSSEngine.DSS" in the
server. Another way to test this is to go into the VBA macro editor (alt-F11) in any of the Microsoft
Office tools (e.g., Excel) and see if "OpenDSS Engine" shows up as an Available Reference under
the Tools>References menu.
Note that EPRI PS174 members who install programs such as DGScreener should register the
server (the DGScreener installs an older version if you do not).
Updates
For most updates, unless otherwise noted, you will need to replace only the OpenDSS.EXE and
the OpenDSSEngine.DLL files. Generally, you should not have to re-register the
OpenDSSEngine.DLL server, but it won't hurt if you do. Only one interface (OpenDSSEngine.DSS)
is registered and we seldom change it. The other interfaces are created at run time.
If course if an Installer is available for the updated version, you may use it.
Note that if you have installed a version manually, the Installer may not find it and overwrite it.
Windows will keep a link to the old version of OpenDSSEngine.DLL and will invoke it when you use
a program that had used it in the past, such as a MATLAB program for an old project. If you find
some feature missing that you were expecting to find, this is a likely explanation. Locate and delete
the older version.
1. Install a 32- or 64-bit TortoiseSVN client, as appropriate for your computer, from
http://tortoisesvn.net/downloads.html.
2. From the TortoiseSVN General Settings dialog and click the last check box, to use "_svn"
instead of ".svn" for local working directory name.
https://svn.code.sf.net/p/electricdss/code/trunk
Change the checkout directory if it points somewhere other than what you want.
That's basically all there is to it. The client will retrieve all the latest source code from
Sourceforge.net. This may take several minutes. This will include the available documentation files,
examples, training powerpoint files, and the OpenDSS versions of most of the IEEE Test Feeders
and EPRI Test Circuits.
DSSobj = actxserver(OpenDSSEngine.DSS);
In VBA
In PYTHON
self.engine = win32com.client.Dispatch("OpenDSSEngine.DSS")
In C#
In Delphi
In C++
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
CoInitialize(NULL);
try {
OpenDSSengine::IDSSPtr DSSObj;
DSSObj.CreateInstance(__uuidof(OpenDSSengine::DSS));
if(DSSObj->Start(0)){
cout<<"openDSS Loaded!"<<endl;
// Do whatever you want, here we show the version
cout<<DSSObj->Version<<endl;
};
} catch (_com_error e) {
printf("\n");
printf("Error: %S\n", e.Description());
printf("Error: %S\n", e.ErrorMessage());
}
cout << "Press anykey to exit.";
cin.ignore();
cin.get();
return 0;
}