Including Simulator Automation Server Functions (version 9)
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 5
- Install the version of PowerWorld Simulator with the Simulator Automation Server included.
- In Delphi 5, 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
- Install the version of PowerWorld Simulator with the Simulator Automation Server included.
- In VB, choose References… from the Tools menu. Find and choose pwrworld Library from the list of references.
- If pwrworld Library is not in the list, click Browse. Change the file type to *.exe, find and choose the Pwrworld.exe file from the PowerWorld Simulator directory, and click Open.
- Click OK to install the Simulator Type Library reference.
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.