From GridLAB-D Wiki
Jump to: navigation, search

The define command line option and the #define directive may be used to set global variables.


When defined a previously undefined global variable, use the following syntax:

#define variable=value


#define DG2_MG2_RatedVA=600000
object diesel_dg {
	parent meter_135;
	name Gen2;
	Rated_V 4156; //Line-to-Line value
	Rated_VA ${DG2_MG2_RatedVA};

If you wish to set an existing global variable you must use the #set directive. Alternatively, you can set the strictnames global variable to FALSE to allow implicit creation of global variables without using set and allow define to overwrite already existing global variables.

Command line

To define or set a global variable from the command line, you can use to available syntax options:

 host% gridlabd --define global=value


 host% gridlabd -D global=value

See also