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

Revision history [back]

If I'm understanding correctly, you do not need to use a trend variable just to retrieve a variable's value from a previous timestep. Rather, just use an EnergyManagementSystem:GlobalVariable. For example:

EnergyManagementSystem:Program,
TemperatureCalculation,
SET Tfinal = Tinitial + 10,
SET Tinitial = Tfinal;

And then set Tinitial as a global EMS variable so that its value at the end of the previous timestep can be used in the program in the subsequent timestep.

If you need to set the initial value for Tinitial for the beginning of the simulation, you can do this by creating a second EMS program that sets it value (e.g., SET Tinitial = 50) and uses the BeginNewEnvironment and/or AfterNewEnvironmentWarmUpIsComplete calling points (I forget which offhand).