Local varaibles in Energyplus EMS
Hi,
I am using local variables within an EMS program for an Openstudio measure to store intermediate results. However, when running the simulation, a fatal error occurs and the .ERR file reads:
Error: EvaluateExpression: Variable = 'MAX_PWR_INCREASE' used in expression has not been initialized!.
However, a value is attributed to the local variable and I thought local variables did not need to be initialized. The following code snippet shows the definition of the local variables and the line at which the program crashes (last line with the @MIN function):
SET previous_timestep_avail_pwr = #{maximum_building_power.name} - #{building_power_dmd.name}
IF @TrendValue #{ets_power_trend.name} 1 > 0
SET max_pwr_increase = 0.5 * @TrendValue #{ets_power_trend.name} 1
ELSE
SET max_pwr_increase = 0.5 * #{maximum_building_power.name}
ENDIF
SET #{available_charging_power.name} =@MIN previous_timestep_avail_pwr max_pwr_increase
Thanks.
Can you attach your full IDF via e.g. Google Drive or Dropbox?
Due to the nature of the project, I cannot share the whole IDF. However, the code for the measure along with a snippet from the IDF where the measure is located are available in this Dropbox link.