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

How to load Schedule:File in OpenStudio?

asked 2019-04-26 11:52:20 -0500

Westely gravatar image

updated 2020-07-19 08:35:14 -0500

I read some posts and see the "schedule:file" works in OpenStudio now. Is there any example measure? I write the following codes (from another post), but it always returns "Error: File could not be found and can not be assigned to ScheduleFile objects". Is it because of the file folder, or some formats? Thanks~

The code is as follows

ext_file = OpenStudio::Model::ExternalFile::getExternalFile(model,"/Users/name/Desktop/hourly_values.csv")
if ext_file.is_initialized
  ext_file = ext_file.get
  puts "Warning, could not find file"
  runner.registerError("File could not be found and can not be assigned to ScheduleFile objects")
  return false

I would like to import pre-calculated HVAC plant load profile, from csv file into OpenStudio, I found "Load Profile Schedule" object in tab Schedule/Library (OS 1.0), but didn't find a way to to import csv file. Maybe I'm wrong when using this object, or someone can help.

I have Load profile schedule here, but I dont know how to link between them to get proper data for plant simulation, simply in the image below. They have the same name: Schedule From File, I'm not sure it's good or not


edit retag flag offensive close merge delete


You can find an example of it being used here.

shorowit gravatar image shorowit  ( 2019-04-26 12:27:22 -0500 )edit

Thanks, got it ~

Westely gravatar image Westely  ( 2019-04-26 13:28:23 -0500 )edit

It sure sounds like your path is wrong. Try puts File.exists?("/Users/name/Desktop/hourly_values.csv") and see what it says.

shorowit gravatar image shorowit  ( 2019-04-26 16:43:09 -0500 )edit

I updated and the path works, but it does not show the schedule object in the model. I will try tomorrow. Thank you for your kind answer~

Westely gravatar image Westely  ( 2019-04-27 00:40:47 -0500 )edit

Does this post answer your question?

Aaron Boranian gravatar image Aaron Boranian  ( 2020-07-15 12:40:26 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-04-26 15:29:08 -0500

You can also add a schedule interval from file with the Add Interval Schedule From File measure on BCL.

edit flag offensive delete link more


Yes, I tried that before. but the measure doesn't work on my laptop. I use openstudio 2.8.0...and I don't know why, so I want to see if schedule:file works better.Thanks

Westely gravatar image Westely  ( 2019-04-26 15:35:33 -0500 )edit

and one more question, when I run the written measure in main post (which runs now) , it shows "Translating the OpenStudio Model to EnergyPlus.Processing EnergyPlus Measures....." Is it correct? Because I developed it as an openstudio measure.

Westely gravatar image Westely  ( 2019-04-26 15:37:03 -0500 )edit

is your measure class inherited from ModelUserScript or WorkspaceUserScript? Model -> openstudio measure. Workspace -> EnergyPlus measure.

mdahlhausen gravatar image mdahlhausen  ( 2019-04-26 15:48:01 -0500 )edit

@Westely thanks for mentioning the schedule file measure was broken. I've fixed it and re-uploaded it to BCL.

mdahlhausen gravatar image mdahlhausen  ( 2019-04-26 17:52:33 -0500 )edit

it is from ModelUserScript as OpenStudio::Measure::ModelMeasure, I just guess may schedule:file translate the model to EnergyPlus automatically....I can use schedule:file in EnergyPlus directly, but I want to run the model in Openstudio.

Westely gravatar image Westely  ( 2019-04-27 00:32:50 -0500 )edit

Your Answer

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

Add Answer


Question Tools



Asked: 2019-04-26 11:52:20 -0500

Seen: 601 times

Last updated: Jul 19 '20