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

Writing OS measure to change Scheduled Setpoint Manager with Outdoor Air Reset Setpoint Manager

asked 2016-01-24 04:04:39 -0600

Dubravka's avatar

Hello! I am not experienced in writing measures but I have made measures to change DH with HW Boiler and to change Headered Constant Speed Pump With Headered Variable Frequancy Pump. I wanted to use such measure to change Scheduled Setpoint Manager with Outdoor Air Reset Setpoint Manager but it doesn't work. Can anybody look at my code and point me in right direction? Thank you in advance for your time.

https://files.mycloud.com/home.php?br...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2016-01-24 09:01:46 -0600

updated 2016-01-24 09:18:46 -0600

When I try to run your measure, I get the following error message: .../user_script.rb:111:in 'run': undefined method 'inletModelObject' for # (NoMethodError) which tells me that at line 111 when you try to 'get the nodes before and after the SetpointManager on the loop', something is wrong. As it turns out, a SetpointManager does not exist as an object between two nodes on a loop, it is rather assigned to a particular node. Looking at the documentation for the SetpointManagerScheduled class, if you click the box at the top to 'List all members' you won't find the inletModelObject method listed, which explains the error: the method you're calling doesn't exist for that class. However, there is a method for that class called setpointNode, which "returns the node referred to by the SetpointNodeName field", i.e. the node the SPM is assigned to.

So that makes it easy to finish out your measure. If you replace lines 111-116 with the following, it should work:

# get the node the selected spm is assigned to
node = selected_setpoint_manager.setpointNode.get
# remove selected, so you don't double up spm's on the node
selected_setpoint_manager.remove
# apply the new spm
new_setpoint_manager.addToNode(node)

PS: nice job on the measure otherwise! The only other thing I'd note is that on line 34 instead of getting all modelObjects and then filtering with to_SetpointManagerSchedule.empty?, you should just be able to do model.getSetpointManagerSchedules to only get those objects from the model. This should work for any modelObjects, e.g. getThermalZones, getSpaces, getAirLoopHVACs, etc.

edit flag offensive delete link more

Comments

@Eric Ringold Thank you very much! I suspected the Node method to be the problem but I didn't see the solution. Measure works perfectly.

Dubravka's avatar Dubravka  ( 2016-01-25 02:10:06 -0600 )edit

I am trying to create a similar measure but have very little experience with measure writing. Do either of you know where I can find a template for this type of measure that might help point me in the right direction?

Draza's avatar Draza  ( 2019-05-07 11:21:13 -0600 )edit

@gnava I'm not aware of an existing publicly-available measure to replace a setpoint manager. Maybe @Dubravka will re-post their code. In the meantime, familiarize yourself with the Measure Writer's Reference, the SDK Documentation and any measure on the BCL related to Air Loops or replacing objects in a model.

ericringold's avatar ericringold  ( 2019-05-07 13:16:03 -0600 )edit

@Eric Ringold Thanks. I have been reading over the Measure Writer's reference and looking through existing measures to see how they work. I am becoming more familiar with the measure writing process, hopefully I will be able to create the measure I need soon.

Draza's avatar Draza  ( 2019-05-07 14:05:53 -0600 )edit

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

1 follower

Stats

Asked: 2016-01-24 04:04:39 -0600

Seen: 568 times

Last updated: Jan 24 '16