Contents - Index
The $INCLUDE directive provides an automatic method for loading a library file, an ASCII text file containing EES equations, an EES macro file (.EMF), a .VAR file that holds variable information and other file types. The format is:
$INCLUDE FILENAME /R
FILENAME is any Windows filename and it must include the filename extension which can be: .TXT, .LIB, .FDL, .DLF, .DLP, .DLL, .EMF, .UNT, .VAR or .PRF. The filename should also include the complete path name, e.g., C:\EES\myDefn.TXT. However, if a path name is not provided, EES will look in the current directory and the directories from which files have been recently loaded. If EES is unable to find the file, it will provide the opportunity to browse so that you can locate it. The $INCLUDE statement must be on a line by itself, starting in column 1. It is best to place the $INCLUDE directives at the top of the Equations Window to ensure that the directive is processed before compilation of the equations is initiated. EES will also accept in place of FILENAME a string variable that has been previously set to a file name in the main block of equations, e.g.,
By default, EES will not reload a library file if it has been previously loaded. However, if the /R flag is provided and filename refers to a library file, it will be reloaded. This option is convenient when you are simultaneously running EES and developing a library file as EES will use the most recent version of the library file without having to restart.
Equations can also be entered from a file with the $INCLUDE directive. If the filename extension is .TXT, EES expects FILENAME to be an ASCII text file containing EES equations. Be sure that there are no errors in these equations, as error checking is limited for files opened in this manner. EES will include these equations with others in the Equations window during compilation. However, the equations will not be visible. Nested use of the $INCLUDE directive is not supported so that the text file must not contain any $INCLUDE statements. Use of the $Include directive can increase the responsiveness of the Equations window because the included equations do not have to be displayed.
If the filename extension is .LIB, .FDL, .DLF, .DLP, or .DLL EES will expect the file to be a library file of a type corresponding to the filename extension. (Note the 64-bit license can also process .LIB64, .FLD64, .DLF64, .DLP64, and .DLL64 library files) EES internal functions and procedures are recognized with the .LIB (or .LIB64) extension, whereas external functions use a .DLF extension and external procedures use either the .FDL or .DLP extension.
.DLL files can contain multiple .DLF, .FDL, and .DLP files. EES will automatically load the referenced library file if it is not already loaded. Note that library files can also be loaded automatically when EES is started by placing them in the USERLIB subdirectory or by applying the Load Library command.
In some cases, a library (.LIB or .LIB64) file may need to call a routine (function, procedure, subprogram) in another library file. To ensure that a routine is not called before the library it exists in is loaded, a $INCLUDE directive can be placed at the top of the library file followed by the complete path name of the library file. $USERLIB is accepted as the USERLIB directory in the EES folder, so the EES folder can be placed anywhere. The following example shows how the internal flow functions in the Heat Exchanger library can be loaded.
$INCLUDE $USERLIB\Heat Transfer\Convection\Internal_flow.lib
If the filename extension is .VAR, EES will expect the file to be a .VAR (Variable information) file that is written with the Save Inputs button in a Diagram Window or with the Save option in the Variable Information dialog in the Professional license of EES.
If the filename extension is .PRF (or .PRF64 for the 64-bit license), EES will expect the file to be a .PRF (EES Preferences) file. A .PRF file holds default values of units settings selected in the Unit System dialog, stop criteria and integration tolerances specified in the Tolerances dialog, default variable information, and all of the information in the Preferences dialog. .PRF files are created when the Store button in clicked in the Unit System, Tolerances, and Preferences dialogs. A .PRF file can be loaded with the Load button in the Preferences dialog or with a $INCLUDE directive.
.UNT1 and .UNT2 Files
If the filename extension is .UN1, EES will expect the file to be a Units List file that holds unit strings. If the filename extension is .UNT2, EES will expect the file to be a file that holds alternate unit strings. These files can be created with a text editor or with the Units List dialog.
Files having a filename extension of .FLD are text files containing the coefficients for the property equations used by the NIST REFPROP program}. EES can read .FLD files (REFPROP V10) for pure fluids and thus provide the thermodynamic property data for the fluid in the same manner as for the built-in fluids. The fluid name used by EES is the .fld file name (without the .fld) appended with _rp.
If the filename extension is .EMF, EES will look for an EES Macro file and automatically load it into the EES Macro Command window. Note that multiple Macro files can be included by providing a $Include directive for each file.
If the filename extension is .DGMF, EES will look for a Diagram (.DGM) file and automatically load that Diagram (and associated child diagram windows).