WriteAuxFile Function: Sample Code

 

Microsoft® Visual Basic for Applications

Dim FieldList As Variant

Dim auxfilename As String

 

' Setup FieldList to send the bus number, gen id and gen agc

FieldList = Array("BusNum", "GenID", "GenAGCAble")

 

' Aux file to write to

auxfilename = "c:\auxiliarydirectory\businfo.aux"

 

' Make the WriteAuxFile call

' By specifying the parameter FieldList, only the three fields

' for each generator will be returned

Output = SimAuto.WriteAuxFile(auxfilename, "", "gen", true, FieldList)

 

' Sending the string "all" instead of the FieldList array

' writes all predefined fields to the Excel spreadsheet

Output = SimAuto.SendToExcel(auxfilename, "", "gen", true, "all")

 

Note:  This function call will send the values of the fields in FieldList to an auxiliary file for all the generators in the load flow case. If a filter name had been passed instead of an empty string, Simulator would have located and used a pre-defined advanced filter and applied it to the information if it was found.

 

Matlab®

% Setup FieldList to send the bus number, gen id and gen agc

fieldlist = {'BusNum' 'GenID' 'GenAGCAble' };

 

% Aux file to write to

auxfilename = 'c:\auxiliarydirectory\businfo.aux';

 

% Make the WriteAuxFile call

Output = SimAuto.WriteAuxFile(auxfilename, '', 'gen', true, FieldList);

 

% Sending the string 'all' instead of the FieldList array

% writes all predefined fields to the .aux file

Output = SimAuto.WriteAuxFile(auxfilename, '', 'gen', true, 'all');

 

Note:  This function call will send the values of the fields in FieldList to an auxiliary file for all the generators in the load flow case. If a filter name had been passed instead of an empty string, Simulator would have located and used a pre-defined advanced filter and applied it to the information if it was found.