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) or a .VAR file that holds variable information. 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, or .VAR. The filename should also include the complete path name, e.g., C:\EESW\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.
If the filename extension is .TXT, EES expects FILENAME to be an ASCII text file containing EES equations (without errors). EES will include these equations with others in the Equations window during compilation. However, the equations and the variables associated with these equations will be hidden. Nested use of the $INCLUDE directive is not supported so that the text file must not contain any $INCLUDE statements.
Equations can also be entered from a file with the $INCLUDE directive. The text entered with the $INCLUDE directive will be hidden.
The speed of editing is reduced as the size of the text in the Equations window increases. Use of the $INCLUDE directive can eliminate this problem.
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. EES internal functions and procedures are recognized with the .LIB extension, whereas external functions use a .DLF extension and external procedures use either the .FDL or .DLP extension. 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) 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 version of EES.
If the filename extension is .PRF, 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.
If the filename extension is .UNT, EES will expect the file to be a Units List file that holds units strings. Units List 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. .