PowerWorld Object Variables
The ability to access power system data for different objects through various Simulator Automation Server functions is based on variables defined in Simulator that can be referred to as Object Field Variables. Each object (i.e. bus, generator, etc.) can have numerous fields associated with it. Each of these fields, in turn, has a variable associated with the field to enable access to the field for the purpose of acquiring or changing data. For example, the GetParametersSingleElement function has a parameter called ParamList, which is intended to store a list of Object Field Variables for a particular type of object. When the function is called, the Simulator Automation Server will return the values associated with each particular field variable for the type of object specified. These field variables allow for complete flexibility by the user in specifying as many or as few fields for a particular object when acquiring or changing data.
Examples of Field Variables: GenMW and BusNum
Simulator has literally thousands of parameters spanning numerous types of device and option specifications. Rather than list all of the field variables and the value they represent in this help file, we have enabled Simulator to automatically generate a text file containing the field variables and a description of what value the variable represents. PowerWorld Corporation highly recommends that you examine this list. To generate this text file, run PowerWorld Simulator and access the Help menu. Choose the option Export Case Object Fields… The list of fields can either be saved to a text file or sent to Excel. The list will consist of the field variables, the type of variable (string, integer, etc.), and a description of the value the field variable represents, with key fields for different objects marked with an asterisk. The field variables will also be split into sections based on the type of object they are valid for. Note that the same field variable may be available for more than one object, but that the value represented by the field variable might vary for different objects.
Legacy Variable Names with Location Integers
When listing object field variables, some field variable names may be augmented with a field location. These are in the format variablename:location. One example of this is the variable name LineMW. For a branch, there are two MW flows associated with the line: one MW flow at the from bus, and one MW flow at the to bus. So that the number of variable names does not become huge, the same variable name is used for both of these values. For the from bus flow, we write LineMW:0, and for the to bus flow, we write LineMW:1. Field variable names using a location of 0, such as LineMW:0, may simply leave off the :0.
Concise Variable Names
Added in Version 19
Variable names within Simulator have been overhauled starting in Version 19. Most no longer utilize the special location integer and instead spell out such information in the field variable name. In general the variable names have been made more concise or at least more understandable if they are longer. Therefore what was once called LineMW:1 for a BRANCH is now called MWTo. Similarly LineMW:2 is now called MWFromCalc (representing the MW flow at the from bus of branch calculated from the terminal voltages). The only fields that continue to use the location integer are those that represent fields for which a dynamic number of fields are available. Examples of this include the CustomInteger, CustomString, and CustomFloat fields which use the location integer to specify which value is used. Other examples include the multiple direction PTDF results fields PTDFMult:0, PTDFMult:1, and so on.
Referring to Variable Name Integer Location by String
There are several variable names that can be referred to by the user-defined variable name for the field rather than using the location number. These are variable names that might have their location numbers change when different auxiliary files are merged in the same case. Referring to these by name can eliminate this possible confusion. These variable names can be defined in the format variablename:location_by_name. They can also be referred to by location number as well.
Variable names that allow referring to the location by name are:
- Expressions = "CustomExpression:my expression name"
- Custom fields (Floating Point, Integer, and String) - "CustomSingle:my custom single name." Using this format for custom fields requires that Custom Field Descriptions be created for the fields to be used.
- Calculated Fields - "BGCalcField:my calculated field name"
Within select SimAuto functions the keyword ALL can be used instead of using the location number of a field when specifying variable names as part of a field list. This will return all fields with the same variable name. This is intended to allow easier access to fields when the exact number of fields is not known, such as with multiple TLR (MultBusTLRSens:ALL) or PTDF (LinePTDFMult:ALL) results. This can be used with SendToExcel and WriteAuxFile functions.