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

Revision history [back]

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.

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: reads:

Error: EvaluateExpression: Variable = 'MAX_PWR_INCREASE' used in expression has not been initialized!''. 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}

#{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

ENDIF SET #{available_charging_power.name} =@MIN previous_timestep_avail_pwr max_pwr_increase

max_pwr_increase

Thanks.

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.

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!'.
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.