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

Revision history [back]

It sounds like you want to use the logical "and" operator: &&. You can read more about operators available for EMS in the Expressions section of the EMS Application Guide.

Also, I don't believe you need LoopWindowAttribute, as the Month and Hour variables are already built in to EMS and not "attached" to specific EnergyPlus objects like windows. You can read more about built-in variables for EMS.

Using && and removing LoopWindowAttribute, your EMS program would look like this:

EnergyManagementSystem:Program,
 NatVent,
 <ForAllExternalWindows>
 IF Zone_People_Occupant_Count_<LoopWindowVariableName> == 0,        
    SET Venting_Opening_Factor_<LoopWindowVariableName> = 0,
 ELSEIF (Zone_People_Occupant_Count_<LoopWindowVariableName> > 0),
    IF Month >=5 && Month <=9 && Hour >=7 && Hour <=9,
      SET Venting_Opening_Factor_<LoopWindowVariableName> = 1,
   ELSE,
      SET Venting_Opening_Factor_<LoopWindowVariableName> = null,
   ENDIF,
 ENDIF,
<LoopNextWindow>
;

You also needed a second ENDIF statement, since you have two IF statements.