Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Calling ReadVarsESO without the 255 columns limit

asked 2015-04-01 03:16:14 -0500

updated 2017-05-08 18:29:54 -0500

I'm using OpenStudio to simulate with EnergyPlus. I want to get a csv file out of it in order to do some post-processing.

As stated in the thread Getting csv from sql, one way to get the csv is to re-run the IDF file generated by OpenStudio through the EP-Launch program. But that would require running the simulation a second time, which I want to avoid.

OpenStudio does save the .eso file, and I can process it just fine using ReadVarsESO that comes with EnergyPlus. The only problem is that I'm getting this message

 ReadVarsESO program starting.
 too many variables requested, will go with first          255

Now, in EP-launch, if you go to Options, then "Miscellaneous", you can tick an option "Allow more than 250 columns", and you'll end up with a csv that has all the reporting variables, even if more than 250 or 255.

So I'm guessing there's a way to call ReadVarsEso with some kind of parameter that tells it to ignore the columns limit.

How can you run the ReadVarsESO without the 255 columns limit?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-04-01 03:35:51 -0500

updated 2015-04-01 03:38:50 -0500

So I ended up figuring it out.

Bottom line

  1. Go to C:\EnergyPlusV8-2-0\PostProcess(or wherever you have installed E+). You should see ReadVarsESO.exe and RunReadESO.bat.

  2. Paste here your eplusout.eso file generated by OpenStudio (located in My_Model\run\5-EnergyPlus-0). Do not rename it! It has to be named eplusout.eso.

  3. Copy the RunReadoESO.bat and rename to RunReadESO-NoLimit.bat.

Open it up and modify like the following (only the fourth line changes)

set rvpath=
if EXIST eplusout.inp goto :inp
rem produces all variables in .eso file to .csv
%rvpath%readvarseso.exe "" N
goto :done
rem reads variable specifications from input file
%rvpath%ReadVarsESO.exe eplusout.inp
set rvpath=

4.Save and close the bat file. Double click on it, done.


I took a look at the source code, and especially ReadVarsEso.f90.

Turns out there a limit of 255 indeed, with this integer, parameter :: numallowed=255

Now, it's only used if another parameter, limited is set to true, which is its default state.

if (ntrack > numallowed) then
   if (limited) then
       write(*,*) 'too many variables requested, will go with first ',numallowed

The interesting section is really this one:

  if (cmdargs == 0) then
  else  ! there are command args, at least one...
    Call Get_Command_Argument(arg,varfilename)
    if (varfilename == blank) then
    do arg=argnum,cmdargs
      Call Get_Command_Argument(arg,LineArg)
      ! timestep
      if (LineArg(1:1) == 't' .or. LineArg(1:1) == 'T') Freqs=1
      **[... 'Truncated for clarity' ...]**
      ! unlimited
      if (LineArg(1:1) == 'u' .or. LineArg(1:1) == 'U') Limited=.false.
      ! nolimit
      if (LineArg(1:1) == 'n' .or. LineArg(1:1) == 'N') Limited=.false.

One thing is that we want getvarsfromeso = .true., otherwise the program will be expecting a .rvi file which we don't have. We just want all variables to get converted to csv.

So if we pass it 0 arguments, it works nicely because getvarsfromeso = .true., but we end up limited to 255 columns, because by default limited=.true..

If we pass it at least one argument, the first one is the filename. In our case, we want the getvarsfromeso = we have to pass it a blank first argument ""

Then, we want to end up with limited=.false., so passing N as a second argument achieves that.

And that's why %rvpath%readvarseso.exe "" N works. But it will be expecting a file named eplusout.eso - that's the default anyway - so that's why I said in 2. above that you couldn't rename it.

edit flag offensive delete link more



Nice post @Julien Marrec, just wanted to make sure you were also aware of this feature request

macumber's avatar macumber  ( 2015-04-01 08:32:43 -0500 )edit

@macumber: I assumed one was made, glad to see it was. I'll welcome it. Right now I'm trying to load the sql output into a python Pandas dataframe, and it ain't going very well :) I've got to brush up on my SQL-like JOIN operations... By the way, I tried to locate the code for how the resultviewer parses out the sql file but couldn't easily locate it. Any pointers as to where to look?

Julien Marrec's avatar Julien Marrec  ( 2015-04-01 09:52:41 -0500 )edit

This is probably the code you want: I'd suggest using a SQLite frontend like Sqliteman to test out your queries.

macumber's avatar macumber  ( 2015-04-01 10:00:32 -0500 )edit

answered 2018-04-17 23:43:03 -0500

Ery Djunaedy's avatar

Continuing on this old thread ...

For linux, do not use /usr/local/bin/runreadvars. That program will not tolerate more than 255 columns.

Use the main program /usr/local/EnergyPlus-8-8-0/PostProcess/ReadVarsESO which can accept unlimited number of columns.

Execute as follows, note the parameter "unlimited" at the end:

/usr/local/EnergyPlus-8-8-0/PostProcess/ReadVarsESO MyRVI.rvi unlimited


/usr/local/EnergyPlus-8-8-0/PostProcess/ReadVarsESO eplusout.eso unlimited
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops


Question Tools



Asked: 2015-04-01 03:16:14 -0500

Seen: 1,433 times

Last updated: Apr 17 '18