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

How to load Schedule:File in OpenStudio?

asked 5 years ago

Westely's avatar

updated 4 years ago

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
else
  puts "Warning, could not find file"
  runner.registerError("File could not be found and can not be assigned to ScheduleFile objects")
  return false
end

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

https://imgur.com/eyMauXm

https://imgur.com/Q3yhXrk

https://imgur.com/PGsbcTj

Thanks.

Preview: (hide)

Comments

You can find an example of it being used here.

shorowit's avatar shorowit  ( 5 years ago )

Thanks, got it ~

Westely's avatar Westely  ( 5 years ago )

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

shorowit's avatar shorowit  ( 5 years ago )

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's avatar Westely  ( 5 years ago )

Does this post answer your question?

Aaron Boranian's avatar Aaron Boranian  ( 4 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 5 years ago

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

Preview: (hide)
link

Comments

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's avatar Westely  ( 5 years ago )

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's avatar Westely  ( 5 years ago )

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

mdahlhausen's avatar mdahlhausen  ( 5 years ago )

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

mdahlhausen's avatar mdahlhausen  ( 5 years ago )

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's avatar Westely  ( 5 years ago )

Your Answer

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

Add Answer

Training Workshops

Careers

Question Tools

2 followers

Stats

Asked: 5 years ago

Seen: 1,121 times

Last updated: Jul 19 '20