Including Simulator Automation Server Functions
Before you can access the functions defined by the Simulator Automation Server when writing the code for your external program, you must first include the library of functions defined for the Simulator Automation Server. This kind of library is referred to as a Type Library, which describes the available functions in a manner that can be interpreted by different programming languages. Importing a Type Library from another program is usually fairly simple, but the procedure does vary depending on the programming tool you are using. Please see the help for your programming tool of choice on how to import a Type Library or COM functions from another program.
Examples
The following examples are just a few specific examples for certain programming media. The procedure may be different for other programming media not listed. In addition, a procedure given for a certain type of programming media may be one variation from several possible procedures for accomplishing the same task.
Borland Delphi
- Install the version of PowerWorld Simulator with the Simulator Automation Server included.
- In Delphi, choose Import Type Library… from the Project menu.
- In the list of libraries, search for and choose pwrworld Library.
- If pwrworld Library is not in the list, click Add. Find and choose the Pwrworld.exe file from the PowerWorld Simulator directory, and click Open.
- You should see the class name TSimulatorAuto in the list of Class names.
- Click Install to include the PowerWorld Simulator Type Library.
Microsoft Visual Basic for Applications
- No additional tasks are necessary
- Importing Type Library still works (See Including Functions for version 9).
Microsoft Visual C++
- Install the version of PowerWorld Simulator with the Simulation Automation Server included.
- Add #import "…\powerworld.exe" in your external program code, using the full path to the PowerWorld Simulator executable program.
- Add using namespace pwrworld in your external program code.
Matlab v.6.5 r.13
- No additional tasks are necessary.