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

# Calling ReadVarsESO without the 255 columns limit

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 close merge delete

Sort by » oldest newest most voted

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
goto :done
:inp
rem reads variable specifications from input file
:done
set rvpath=


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

### Explanation

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
ntrack=numallowed
write(*,*) 'too many variables requested, will go with first ',numallowed


The interesting section is really this one:

cmdargs=Command_Argument_Count()
if (cmdargs == 0) then
getvarsfromeso=.true.
else  ! there are command args, at least one...
arg=1
Call Get_Command_Argument(arg,varfilename)
if (varfilename == blank) then
getvarsfromeso=.true.
endif
argnum=arg+1
Freqs=0
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.
enddo
endif


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 = .true.so 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.

more

1

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

( 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?

( 2015-04-01 09:52:41 -0500 )edit

This is probably the code you want: https://github.com/NREL/OpenStudio/bl.... I'd suggest using a SQLite frontend like Sqliteman to test out your queries.

( 2015-04-01 10:00:32 -0500 )edit

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


or

/usr/local/EnergyPlus-8-8-0/PostProcess/ReadVarsESO eplusout.eso unlimited

more