EMS with Openstudio debugging
Hi, I have the following line in my measure.rb file
ets_heating_energy = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(model, "EtsHeatingEnergy")
I get the following error
[openstudio.model.EnergyManagementSystemGlobalVariable] Unable to set Object of type 'OS:EnergyManagementSystem:GlobalVariable' and named 'EtsHeatingEnergy_1''s Name to EtsHeatingEnergy.
What am I doing wrong ?
Is it possible that this code gets called multiple times and is trying to create multiple global variables with the same name?
Not in this case, the error is strange, I have many global variables defined just before this particular line that are read with no problems
The fact that the error message says "EtsHeatingEnergy_1", as if it renamed it from "EtsHeatingEnergy" to avoid a conflict, suggests to me that there might already be an object with the same name. But I could be totally off base.
@shorowit I think you're right - I get the same error when I try to call the same global variable constructor twice.
I think you're right too although it wasn't that obvious in my case. I was using the global variable to program a
PlantComponent:UserDefined
( PCUD) object. I had a first successful run of the measure, but when tried to run again after an edit, I got the error, I think because the same global variable already existed within the program of the previously added PCUD object. When I reload the osm file or delete the PCUD object and then re-add my edited measure, it works.