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

Revision history [back]

In an EMS Program, you should only use two equal signs "==" within a logic statement (IF, ELSE, etc.). When defining a SET statement, you only need one equal sign "=". So all of your EMS Program lines setting the absorptance values should use one equal sign near the right end of the lines.

...
if Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> < 28,
set Surface_Property_Solar_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Thermal_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Visible_Absorptance_<LoopSurfaceVariableName> = 0.9,
...

You can read more in the EMS Application Guide about statement keywords and see some examples in various expressions.

In an EMS Program, you should only use two equal signs "==" within a logic statement (IF, ELSE, etc.). When defining a SET statement, you only need one equal sign "=". So all of your EMS Program lines setting the absorptance values should use one equal sign near the right end of the lines.

...
if Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> < 28,
set Surface_Property_Solar_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Thermal_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Visible_Absorptance_<LoopSurfaceVariableName> = 0.9,
...

You can read more in the EMS Application Guide about statement keywords and see some examples in various expressions.

UPDATE

The original post above settles some syntax issues in the EMS program, but your EMS Actuator also has issues. You are trying to read EMS sensors for every exterior surface, then use that sensor data to change the absorption of the outermost material layer of that surface. You are correctly looping over surfaces to create the EMS actuator, but the actuator information you have entered is for material layers. These are different types of objects in the model, which is why you're still getting severe errors after the syntax fixes above.

If you want to potentially change the absorption of the outermost material layer of any exterior surface, then you will need to change your EMS script approach. Instead of directly setting absorptance in your EMS program, you should be setting the Surface Construction State. This is an EMS Actuator that works with an EMS Construction Index Variable object that is connected to a specific construction assembly defined in the model. With this new approach, you will have to:

  1. Create three material layers in your model -- one for each of the absorptance values you want to apply with your EMS program
  2. Create three constructions in your model -- these are almost identical with the only thing changing is the outermost layer touching outdoor air is one of the three material layers created in the previous step
  3. Create thee EMS Construction Index Variables in your EMS script -- one for each of the three constructions created in the previous step
  4. Update your loop creating EMS Actuators for each surface to only create one actuator for the construction state (don't need 3 actuators for each surface anymore)
  5. Update your EMS Program to set the construction state for each surface to the appropriate EMS Construction Index Variable according to the same if/elsif/else temperature checks and loop for all exterior surfaces

Example:

<ForAllExternalSurfaces>
EnergyManagementSystem:Sensor,
  Surface_Outside_Face_Temperature_<LoopSurfaceVariableName>,
  <LoopSurfaceIDFName>,
  Surface Outside Face Temperature;
<LoopNextSurface>

<ForAllExternalSurfaces>
EnergyManagementSystem:Actuator,
  Surface_Cons_State_<LoopSurfaceVariableName>,
  <LoopSurfaceIDFName>,
  Surface,
  Construction State;
<LoopNextSurface>

EnergyManagementSystem:ConstructionIndexVariable,
  EMS_Cons_High_Abs,    !- Name
  High Absorptance Construction;              !- Construction Object Name (needs to match name of construction assembly you defined in the model)

EnergyManagementSystem:ConstructionIndexVariable,
  EMS_Cons_Mid_Abs,    !- Name
  Mid Absorptance Construction;              !- Construction Object Name (needs to match name of construction assembly you defined in the model)

EnergyManagementSystem:ConstructionIndexVariable,
  EMS_Cons_Low_Abs,    !- Name
  Low Absorptance Construction;              !- Construction Object Name (needs to match name of construction assembly you defined in the model)

EnergyManagementSystem:ProgramCallingManager,
  Thermo,
  BeginTimestepBeforePredictor,
  Thermo;

EnergyManagementSystem:Program,
  Thermo,
  <ForAllExternalSurfaces>
  if Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> < 28,
  set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_High_Abs,
  elseif Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> > 28,
  set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_Low_Abs,
  elseif Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> == 28,
  set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_Mid_Abs,
  endif,
  <LoopNextSurface>
  ;

You can read more information about this process in an Unmet Hours post as well as review an example for thermochromic windows from EnergyPlus EMS Application guide.

In an EMS Program, you should only use two equal signs "==" within a logic statement (IF, ELSE, etc.). When defining a SET statement, you only need one equal sign "=". So all of your EMS Program lines setting the absorptance values should use one equal sign near the right end of the lines.

...
if Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> < 28,
set Surface_Property_Solar_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Thermal_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Visible_Absorptance_<LoopSurfaceVariableName> = 0.9,
...

You can read more in the EMS Application Guide about statement keywords and see some examples in various expressions.

UPDATE

The original post above settles some syntax issues in the EMS program, but your EMS Actuator also has issues. You are trying to read EMS sensors for every exterior surface, then use that sensor data to change the absorption of the outermost material layer of that surface. You are correctly looping over surfaces to create the EMS actuator, but the actuator information you have entered is for material layers. These are different types of objects in the model, which is why you're still getting severe errors after the syntax fixes above.

If you want to potentially change the absorption of the outermost material layer of any exterior surface, then you will need to change your EMS script approach. Instead of directly setting absorptance in your EMS program, you should be setting the Surface Construction State. This is an EMS Actuator that works with an EMS Construction Index Variable object that is connected to a specific construction assembly defined in the model. With this new approach, you will have to:

  1. Create three material layers in your model -- one for each of the absorptance values you want to apply with your EMS program
  2. Create three constructions in your model -- these are almost identical with the only thing changing is the outermost layer touching outdoor air is one of the three material layers created in the previous stepstep.
  3. Save your DB model and export the EnergyPlus input data file (IDF). Search for the name of the 3 Construction objects you created in the previous step to see if the names are identical to what you entered in DB or if DB has changed them in some way when creating the IDF.
  4. Create thee EMS Construction Index Variables in your EMS script -- one for each of the three constructions created in Construction names reviewed in the IDF from the previous stepstep.
  5. Update your loop creating EMS Actuators for each surface to only create one actuator for the construction state (don't need 3 actuators for each surface anymore)
  6. Update your EMS Program to set the construction state for each surface to the appropriate EMS Construction Index Variable according to the same if/elsif/else temperature checks and loop for all exterior surfaces

Example:

<ForAllExternalSurfaces>
EnergyManagementSystem:Sensor,
  Surface_Outside_Face_Temperature_<LoopSurfaceVariableName>,
  <LoopSurfaceIDFName>,
  Surface Outside Face Temperature;
<LoopNextSurface>

<ForAllExternalSurfaces>
EnergyManagementSystem:Actuator,
  Surface_Cons_State_<LoopSurfaceVariableName>,
  <LoopSurfaceIDFName>,
  Surface,
  Construction State;
<LoopNextSurface>

EnergyManagementSystem:ConstructionIndexVariable,
  EMS_Cons_High_Abs,    !- Name
  High Absorptance Construction;              !- Construction Object Name (needs to match name of construction assembly you defined in the model)
Construction object in exported IDF)

EnergyManagementSystem:ConstructionIndexVariable,
  EMS_Cons_Mid_Abs,    !- Name
  Mid Absorptance Construction;              !- Construction Object Name (needs to match name of construction assembly you defined in the model)
Construction object in exported IDF)

EnergyManagementSystem:ConstructionIndexVariable,
  EMS_Cons_Low_Abs,    !- Name
  Low Absorptance Construction;              !- Construction Object Name (needs to match name of construction assembly you defined in the model)
Construction object in exported IDF)

EnergyManagementSystem:ProgramCallingManager,
  Thermo,
  BeginTimestepBeforePredictor,
  Thermo;

EnergyManagementSystem:Program,
  Thermo,
  <ForAllExternalSurfaces>
  if Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> < 28,
  set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_High_Abs,
  elseif Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> > 28,
  set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_Low_Abs,
  elseif Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> == 28,
  set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_Mid_Abs,
  endif,
  <LoopNextSurface>
  ;

You can read more information about this process in an Unmet Hours post as well as review an example for thermochromic windows from EnergyPlus EMS Application guide.