Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page

# How to use Command line

I got some issues with running E+ from CMD. Lets say I wanna to run 5ZoneAirCooled.idf (as example file) . I tried different scripts but the process is always terminated!

Here is my script;

c:\>EnergyPlusV8-7-0\Epl-run c:\EnergyyPlusV8-7-0\Energy+.idd c:\EnergyPlusV8-7-0\ExampleFiles\5ZoneAirCooled c:\EnergyPlusV8-7-0\ExampleFiles\5ZoneAirCooled idf "C:\EnergyPlusV8-7-0\WeatherData\USA_VA_Sterling-Washington.Dulles.Intl.AP.724030_TMY3.epw" EP N nolimit N N 0 Y


and what I got after running the script:

c:\>IF "FALSE" == "FALSE" DEL Energy+.idd
Could Not Find c:\Energy+.idd

c:\>IF "FALSE" == "FALSE" DEL Energy+.ini
Could Not Find c:\Energy+.ini

c:\>goto :done

c:\>if EP == Y pause

edit retag close merge delete

Please use existing (and relevant) tags. "how to use command line" isn't a good tag. Thanks!

( 2017-09-14 02:47:09 -0600 )edit

Sort by » oldest newest most voted

I don't have a windows machine, so I'm not 100% sure the CLI is available on Windows or not, but I don't see any reason it wouldn't it's coded in C++ like the rest of E+ (CommandLineInterface.cc)

First, prior to v8.4 EnergyPlus uses to be run in command line using a batch file (the one you're using). This is no longer the case, and EnergyPlus now has a proper Command Line Interface (or 'cli'), which documentation can be found here.

If the energyplus isn't in your PATH, you'll need to use the full path (on mac that's /Applications/EnergyPlus-8-7-0/energyplus) or set your path correctly.

Display the help:

energyplus --help


Run a model test.idf in the current directory, with a weather file called weather.epw in the current directory as well, and output to a directory named out-test:

energyplus -w weather.epw -d out-test/ test.idf


By default it picks up the Energy+.idd from the same folder as where the energyplus executable is (so /Applications/EnergyPlus-8-7-0/Energy+.idd in my case). If you need to supply another one, use -i path_to_Energy+.idd (or --idd)

Obviously, all paths above can be made absolute if there aren't in current directory, or can be made relative. Here's a mixed example:

energyplus \
--idd ~Software/Others/EnergyPlus-build/Products/Energy+.idd \ # Absolute path
-w ../Weather/weather.epw \   # Relative path (one folder up, then inside Weather/)
-d out-test/ \   # Current directory (relative path too)
test.idf   # Current directory


If you really want to run Epl-run.bat, see the parameters its documentation here. If I decompose your query, I think the problem is that you're passing the idd as the first argument, when the first argument should be the input file without extension. The batch should will look for the .ini and .idd in the current directory.

c:\>EnergyPlusV8-7-0\Epl-run = Program to run
c:\EnergyyPlusV8-7-0\Energy+.idd = **Don't pass this!**
c:\EnergyPlusV8-7-0\ExampleFiles\5ZoneAirCooled = contains the file with full path and no extensions for input files
c:\EnergyPlusV8-7-0\ExampleFiles\5ZoneAirCooled = contains the file with full path and no extensions for output files
idf = extension of the input file
"C:\EnergyPlusV8-7-0\WeatherData\USA_VA_Sterling-Washington.Dulles.Intl.AP.724030_TMY3.epw" = contains the file with full path and extension for the weather file

EP = a weather file is used
N = no pause
nolimit = no 250 columns limit in readVarsESO
N = Don't call convertESOMTR
N = Don't call csvProc
0 = ??
Y = ??

more

Confirmed that it's present on windows too (src/EnergyPlus/CMakeLists.txt#L613)

( 2017-09-14 03:22:58 -0600 )edit
2

the command energyplus -w weather.epw -o out-test/ test.idf has a small typo. It should be: energyplus -w weather.epw -d out-test/ test.idf

( 2019-10-12 15:57:04 -0600 )edit

Done thank you!

( 2019-10-13 05:20:35 -0600 )edit

If you are interested in using a batch file instead of the normal EnergyPlus command line, the batch file intended to be used is RunEPlus.bat. Using the RunEPlus.bat file is documented in the AuxiliaryPrograms.pdf under the section titled "Technical Details for Running EnergyPlus." The EPL-run.bat file is made to be used with EP-Launch.

( 2019-10-15 12:36:59 -0600 )edit

Modelkit has an energyplus-run function that simplifies command line executions. Check out this video demonstrating modelkit commands, and the following video showing how to use a rakefile to automate these commands.

more