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

Revision history [back]

click to hide/show revision 1
initial version

EMS - load existing schedule value each timestep

I'm trying to write an EMS program that will apply a Gaussian multiplier to the occupancy value of each space at each timestep (using the EMS editor in DesignBuilder). To do this, I need the Schedule:Value for the occupancy schedule of each zone. However, in the idf, the Schedule Name is associated with the zone, and the schedule values are associated with the schedule name, so the schedule values are not a direct property of the zone. Therefore, the Sensor object will not return a schedule value when I loop over zones.

How do loop over all zones and access the occupancy Schedule Value for each zone? The code below does not run, but I thought it was the best illustration of what I was trying to accomplish. Thanks for your help.

<foralloccupiedzones> EnergyManagementSystem:Sensor, Schedule_Value, Number of People SCHEDULE Name <loopzoneidfname>, Schedule Value; <loopnextzone>

<foralloccupiedzones> EnergyManagementSystem:Actuator, Number_of_People_<loopzonevariablename>, PEOPLE <loopzoneidfname>, People, Number of People; <loopnextzone>

<foralloccupiedzones> EnergyManagementSystem:InternalVariable, People_Count_Design_Level_<loopzonevariablename>, PEOPLE <loopzoneidfname>, People Count Design Level; <loopnextzone>

EnergyManagementSystem:ProgramCallingManager, Occupancy Factor, BeginTimestepBeforePredictor, OccFactor;

EnergyManagementSystem:Program, OccFactor, <foralloccupiedzones> Set Number_of_People_<loopzonevariablename> = Schedule_ValuePeople_Count_Design_Level_<loopzonevariablename>, Set fac = @RandomNormal 1 0.2 0.5 1.5, Set Number_of_People_<loopzonevariablename> = facNumber_of_People_<loopzonevariablename>, <loopnextzone> ! add program code ;

EMS - load existing schedule value each timestep

I'm trying to write an EMS program that will apply a Gaussian multiplier to the occupancy value of each space at each timestep (using the EMS editor in DesignBuilder). To do this, I need the Schedule:Value for the occupancy schedule of each zone. However, in the idf, the Schedule Name is associated with the zone, and the schedule values are associated with the schedule name, so the schedule values are not a direct property of the zone. Therefore, the Sensor object will not return a schedule value when I loop over zones.

How do loop over all zones and access the occupancy Schedule Value for each zone? The code below does not run, but I thought it was the best illustration of what I was trying to accomplish. Thanks for your help.

<foralloccupiedzones>

<ForAllOccupiedZones>
EnergyManagementSystem:Sensor,
   Schedule_Value,
   Number of People SCHEDULE Name <loopzoneidfname>,
<LoopZoneIDFName>,
   Schedule Value;
<loopnextzone>

<foralloccupiedzones> <LoopNextZone> <ForAllOccupiedZones> EnergyManagementSystem:Actuator, Number_of_People_<loopzonevariablename>, Number_of_People_<LoopZoneVariableName>, PEOPLE <loopzoneidfname>, <LoopZoneIDFName>, People, Number of People; <loopnextzone>

<foralloccupiedzones> <LoopNextZone> <ForAllOccupiedZones> EnergyManagementSystem:InternalVariable, People_Count_Design_Level_<loopzonevariablename>, People_Count_Design_Level_<LoopZoneVariableName>, PEOPLE <loopzoneidfname>, <LoopZoneIDFName>, People Count Design Level; <loopnextzone>

<LoopNextZone> EnergyManagementSystem:ProgramCallingManager, Occupancy Factor, BeginTimestepBeforePredictor, OccFactor;

OccFactor; EnergyManagementSystem:Program, OccFactor, <foralloccupiedzones> <ForAllOccupiedZones> Set Number_of_People_<loopzonevariablename> Number_of_People_<LoopZoneVariableName> = Schedule_ValuePeople_Count_Design_Level_<loopzonevariablename>, Schedule_Value*People_Count_Design_Level_<LoopZoneVariableName>, Set fac = @RandomNormal 1 0.2 0.5 1.5, Set Number_of_People_<loopzonevariablename> Number_of_People_<LoopZoneVariableName> = facNumber_of_People_<loopzonevariablename>, <loopnextzone> fac*Number_of_People_<LoopZoneVariableName>, <LoopNextZone> ! add program code ;

;

EMS - load existing schedule value each timestep

I'm trying to write an EMS program that will apply a Gaussian multiplier to the occupancy value of each space at each timestep (using the EMS editor in DesignBuilder). To do this, I need the Schedule:Value for the occupancy schedule of each zone. However, in the idf, the Schedule Name is associated with the zone, and the schedule values are associated with the schedule name, so the schedule values are not a direct property of the zone. Therefore, the Sensor object will not return a schedule value when I loop over zones.

How do loop over all zones and access the occupancy Schedule Value for each zone? The code below does not run, but I thought it was the best illustration of what I was trying to accomplish. Thanks for your help.

<ForAllOccupiedZones>
EnergyManagementSystem:Sensor,
   Schedule_Value,
   Number of People SCHEDULE Name <LoopZoneIDFName>,
   Schedule Value;
<LoopNextZone>

<ForAllOccupiedZones>
EnergyManagementSystem:Actuator,
   Number_of_People_<LoopZoneVariableName>,
   PEOPLE <LoopZoneIDFName>,
   People,
   Number of People;
<LoopNextZone>

<ForAllOccupiedZones>
EnergyManagementSystem:InternalVariable,
   People_Count_Design_Level_<LoopZoneVariableName>,
   PEOPLE <LoopZoneIDFName>,
   People Count Design Level;
<LoopNextZone>

EnergyManagementSystem:ProgramCallingManager,
   Occupancy Factor,
   BeginTimestepBeforePredictor,
   OccFactor;

EnergyManagementSystem:Program,
   OccFactor,
<ForAllOccupiedZones>
   Set Number_of_People_<LoopZoneVariableName> = Schedule_Value*People_Count_Design_Level_<LoopZoneVariableName>,
   Set fac = @RandomNormal 1 0.2 0.5 1.5,
   Set Number_of_People_<LoopZoneVariableName> = fac*Number_of_People_<LoopZoneVariableName>,
<LoopNextZone>
   ! add program code
    ;