ASPEN PowerScript is a scripting tool embedded in ASPEN OneLiner and ASPEN Power Flow Program to enable users to “drive” the programs with instructions written in BASIC. You can use PowerScript to examine and modify all the system and network parameters and utilize OneLiner and Power Flow as solution engines.
PowerScript has many applications. In the simplest form, a script can be just a few lines of instructions designed to automate a frequently performed task. For instance you can write a script in OneLiner to find the highest fault current at a bus with the adjacent branches outaged one at a time. Simple scripts of this type are commonly referred to as “macros.”
With a slightly more complicated script, you can use PowerScript to create customized reports of network parameters and solution variables. As an example, you can create your own report in Power Flow to list all the PV buses whose output is pegged at the maximum or minimum value.
A script can be a full-fledged computer program with its own decision-making capabilities and computational logic. A OneLiner user, for example, can write a script to locate a fault by simulating a number of faults along a line and compare the voltage and current solutions to the values recorded to find the best match. A Power Flow user can write a script to perform outage studies.
PowerScript has a wide range of input/output capabilities. A script can open disk files for reading in or writing out any kind of text or binary data. It can also interact with the user through dialog boxes and keyboard handling routines. PowerScript comes with a built-in dialog box editor that makes designing dialog boxes a snap. The editor has all standard dialog-box controls such as Edit, List, and Combo boxes, and Check and Radio buttons.
PowerScript supports OLE Automation, a widely used standard for connecting computer software made by different vendors. This means a script can utilize and manipulate programs, such as MS Word and Excel, which are written as OLE containers. In a sample power-flow script that finds the maximum MW transfer between two areas, the script sends the solution to Excel and directs it to plot the classical voltage-versus-MW curve. The possibility of what you can do with PowerScript is limitless.
A text editor is built into OneLiner and Power Flow to enable you to modify scripts. The build-in script editor has many advanced features including syntax highlighting. A symbolic debugger for PowerScript is also built-in. In the debug mode, you can stop the script at any point and examine all the program variables.
Many example scripts are included with OneLiner and Power Flow. Some of these scripts are useful applications of their own right. We encourage you to take a close look at these scripts.