EMS global variables are not initialized properly(E+ V23.1)
I am studying simple EMS script as below.
This is quiet simple script, but there are always EMS errors in the EDD file after complete the run.
The variable 'Var1' is global variable, and I test various EMS calling points for the initialization(see IDF script).
However, the EDD file always tell me that the 'Var1' is not initialized.
How can I fix this?
PROGRAM1,Line 1,IF VAR1 == 0, * Error: EvaluateExpression: Variable = 'VAR1' used in expression has not been initialized! * , During Warmup, Occurrence info=RUN PERIOD 1, 01/01 00:00 - 00:05
PROGRAM1,Line 6,SET VAR1 = VAR1+1, * Error: EvaluateExpression: Variable = 'VAR1' used in expression has not been initialized! * , During Warmup, Occurrence info=RUN PERIOD 1, 01/01 00:00 - 00:05
PROGRAM1,Line 1,IF VAR1 == 0, * Error: EvaluateExpression: Variable = 'VAR1' used in expression has not been initialized! * , During Warmup, Occurrence info=RUN PERIOD 1, 01/01 00:00 - 00:05
PROGRAM1,Line 6,SET VAR1 = VAR1+1, * Error: EvaluateExpression: Variable = 'VAR1' used in expression has not been initialized! * , During Warmup, Occurrence info=RUN PERIOD 1, 01/01 00:00 - 00:05
PROGRAM1,Line 1,IF VAR1 == 0, * Error: EvaluateExpression: Variable = 'VAR1' used in expression has not been initialized! * , During Warmup, Occurrence info=RUN PERIOD 1, 01/01 23:55 - 24:00
PROGRAM1,Line 6,SET VAR1 = VAR1+1, * Error: EvaluateExpression: Variable = 'VAR1' used in expression has not been initialized! * , During Warmup, Occurrence info=RUN PERIOD 1, 01/01 23:55 - 24:00
!- =========== ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:PROGRAMCALLINGMANAGER ===========
EnergyManagementSystem:ProgramCallingManager,
run1, !- Name
BeginTimestepBeforePredictor, !- EnergyPlus Model Calling Point
program1; !- Program Name 1
EnergyManagementSystem:ProgramCallingManager,
inititate1, !- Name
AfterComponentInputReadIn, !- EnergyPlus Model Calling Point
init1; !- Program Name 1
EnergyManagementSystem:ProgramCallingManager,
initiate2, !- Name
BeginNewEnvironment, !- EnergyPlus Model Calling Point
init1; !- Program Name 1
EnergyManagementSystem:ProgramCallingManager,
initiate3, !- Name
EndOfZoneSizing, !- EnergyPlus Model Calling Point
init1; !- Program Name 1
EnergyManagementSystem:ProgramCallingManager,
initiate4, !- Name
AfterNewEnvironmentWarmUpIsComplete, !- EnergyPlus Model Calling Point
init1; !- Program Name 1
!- =========== ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:PROGRAM ===========
EnergyManagementSystem:Program,
program1, !- Name
IF var1 == 0, !- Program Line 1
SET aa = 1, !- Program Line 2
ELSE, !- A4
SET aa = 2, !- A5
ENDIF, !- A6
SET var1 = var1+1; !- A7
EnergyManagementSystem:Program,
init1, !- Name
SET var1 = 0; !- Program Line 1
!- =========== ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:GLOBALVARIABLE ===========
EnergyManagementSystem:GlobalVariable,
var1; !- Erl Variable 1 Name
Are you sure you linked to the correct file? It ran successfully for me.
EnergyPlus Completed Successfully-- 0 Warning; 0 Severe Errors; Elapsed Time=00hr 00min 0.64sec
Oh, sorry, I see the errors in the EDD file.
Feels like an E+ bug to me. I noticed the errors go away if you use a timestep of 1 hour. One set of errors also goes away when you use the calling point manager "EndOfSystemTimestepAfterHVACReporting", but that defeats the purpose of what you're trying to do. I suggest submitting a bug report at https://github.com/NREL/EnergyPlus/is...
That being said, here's an IDF from our software that works without EDD errors. Same timestep as you and only needs two calling points for the initialization program. Look at the
mech_vent_cfis_t_sum_open_0
variable. I don't see how it's different than your example but maybe you'll find a clue.Issue posted at https://github.com/NREL/EnergyPlus/is...