ListOfDevices Function (version 9)
The ListOfDevices function is used to request a list of objects and their key fields from the Simulator Automation Server. The function can return all devices of a particular type, or can return only a list of devices of a particular type based on an advanced filter defined for the loaded case. This function is best used in conjunction with a looping procedure and the ChangeParameters or GetParameters functions to process a group of devices.
ListOfDevices(tObjType, EString, filterName, objList1, {objList2}, {objList3})
Parameter Definitions
TobjType : String The type of object for which you are acquiring the list of devices. No default.
EString : Variant This parameter must be assigned a variable declared as a Variant. This parameter is for a return value only, and will assign the passed variable a string representing an error that may have occurred in the Simulator Automation Server. If no error occurred, the EString variable will return an empty string.
FilterName : String The name of an advanced filter defined in the load flow case open in the Simulator Automation Server. If the filter cannot be found, the server will default to returning all objects in the case of type TobjType.
ObjList1 : Variant This parameter must be assigned a variable declared as a Variant. The Simulator Simulation Server will return a variant array filled with the first key field for the devices of type TobjType. This parameter is required for all types of devices.
ObjList2 : Variant This parameter may be optional. For device types that only have one key field, you can omit passing a variable for this parameter. If the device type requested has two or more key fields, then this parameter must be assigned a variable declared as a Variant. The Simulator Simulation Server will return a variant array filled with the second key field for the devices of type TobjType.
ObjList3 : Variant This parameter may be optional. For device types that have one or two key fields, you can omit passing a variable for this parameter. If the device type requested has three key fields, then this parameter must be assigned a variable declared as a Variant. The Simulator Simulation Server will return a variant array filled with the third key field for the devices of type TobjType.
Example
ListOfDevices("gen", EString, "", objList1, objList2)
This function call will return a list of all generators in the load flow case. By passing an empty string as the filter name, Simulator will not use an advanced filter before returning the generator key fields. Since generators have two key fields, bus number and ID, it was required to pass two variant array variables to receive the key fields. Each generator in the case would have its bus number returned in objList1 and ID in objList2. The corresponding bus number and ID are stored in the same index position in the two arrays. If only one variant array, objList1, had been passed in this instance, an error would have been returned stating more arrays were necessary. If the third variant array, objList3, had been included, Simulator would have still returned the key fields in objList1 and objList2, and would have returned objList3 as an empty variant.