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

Revision history [back]

click to hide/show revision 1
initial version

Variable Key Value - External Interface - EnergyPlus-co-simulation-toolbox

Hello everyone!

I am using EnergyPlus to model a cold room, and I am using the EnergyPlus-co-simulation-toolbox to connect it with MATLAB. The toolbox functions properly when I exchange output variables like Zone Outdoor Air Drybulb Temperature, Zone Air Temperature, or any other variable related to the cold room zone.

However, when I attempt to retrieve the value for the Compressor Electric Power "Variable: Refrigeration Air Chiller System Total Compressor Electric Power", the error below is displayed.

  • Could someone provide insight into the cause of this error?
  • What value should be assigned to the "key value" in this context?
  • Additionally, I would appreciate guidance in determining the appropriate "key value" for an output variable.

Error:

Error using mlep/decodePacket (line 56) Invalid packet format: length is only 1.
Error in mlep/read (line 321) flag, time, rValOut] = mlep.decodePacket(readPacket);
Error in MLEP (line 39) [y, t] = ep.read; %read EnergyPlus outputs at current timestep

Variable Key Value - External Interface - EnergyPlus-co-simulation-toolbox

Hello everyone!

I am using EnergyPlus to model a cold room, and I am using the EnergyPlus-co-simulation-toolbox to connect it with MATLAB. The toolbox functions properly

I have trouble understanding when I exchange output it comes to the "Key Value".

To configure the data mapping between EnergyPlus and the external interface, we have to create an XML file (called variables.cfg) in which we declare the variables like that the external interface sends or reads. For reading data, the "variable source" is set “EnergyPlus", because they are computed by EnergyPlus, "EnergyPlus name" should be set to the zone name "ZoneName" which is the "Key Value" in the Output:Variable object, while "type" should be the variable name "Zone Outdoor Air Drybulb Temperature", as shown below.

< variable source = "EnergyPlus">

< EnergyPlus name = "ZoneName" type= "Zone Outdoor Air Drybulb Temperature"/>

< /variable >

Output:Variable,
    ZN,                                       !- Key Value 
    Zone Outdoor Air Drybulb TemperatureTemperature,     !- Variable Name
    Timestep;                                 !- Reporting Frequency

I have learned that the "Key Value" is not always the zone name. I found an example in "ExternalInterfacesApplicationGuide" in which they defined the ExternalInterface:Schedule as an Output variable and the key value was the ExternalInterface:Schedule name, as shown below

ExternalInterface:Schedule ,
     TSetCoo , Zone Air Temperature        !- Name 
     Temperature , or any other     !- ScheduleType 
     24;               !- Initial value , used during warm-up

Output:Variable ,
     TSetCoo ,              !- Key Value
     Schedule Value ,       !- Variable Name
     TimeStep;              !- Reporting Frequency

My question is, what is the appropriate "Key value" to use if I want to read the Output variable related to the cold room zone.

However, when I attempt to retrieve the value for the Compressor Electric Power "Variable: Refrigeration "Refrigeration Air Chiller System Total Compressor Electric Power", the error below is displayed.

  • Could someone provide insight into the cause of this error?
  • What value should be assigned to the "key value" in this context?
  • Additionally, I would appreciate guidance in determining the appropriate "key value" for an output variable.

Error:

Error using mlep/decodePacket (line 56) Invalid packet format: length is only 1.
Error in mlep/read (line 321) flag, time, rValOut] = mlep.decodePacket(readPacket);
Error in MLEP (line 39) [y, t] = ep.read; %read EnergyPlus outputs at current timestep
Power" ?

I hope I explained the problem clearly.

Variable Key Value - External Interface - EnergyPlus-co-simulation-toolbox

Hello everyone!

I am using EnergyPlus to model a cold room, and I am using the EnergyPlus-co-simulation-toolbox to connect it with MATLAB.

I have trouble understanding when it comes to the "Key Value".

To configure the data mapping between EnergyPlus and the external interface, we have to create an XML file (called variables.cfg) in which we declare the variables that the external interface sends or reads. For reading data, the "variable source" is set “EnergyPlus", because they are computed by EnergyPlus, "EnergyPlus name" should be set to the zone name "ZoneName" which is the "Key Value" in the Output:Variable object, while "type" should be the variable name "Zone Outdoor Air Drybulb Temperature", as shown below.

< variable <variable source = "EnergyPlus">

< EnergyPlus <EnergyPlus name = "ZoneName" type= "Zone Outdoor Air Drybulb Temperature"/>

< /variable >

Temperature"/> </variable >
Output:Variable,
    ZN,                                       !- Key Value 
    Zone Outdoor Air Drybulb Temperature,     !- Variable Name
    Timestep;                                 !- Reporting Frequency

I have learned that the "Key Value" is not always the zone name. I found an example in "ExternalInterfacesApplicationGuide" in which they defined the ExternalInterface:Schedule as an Output variable and the key value was the ExternalInterface:Schedule name, as shown below

ExternalInterface:Schedule ,
     TSetCoo ,         !- Name 
     Temperature ,     !- ScheduleType 
     24;               !- Initial value , used during warm-up

Output:Variable ,
     TSetCoo ,              !- Key Value
     Schedule Value ,       !- Variable Name
     TimeStep;              !- Reporting Frequency

My question is, what is the appropriate "Key value" to use if I want to read the Output variable "Refrigeration Air Chiller System Total Compressor Electric Power" ?

I hope I explained the problem clearly.

Variable Key Value - External Interface - EnergyPlus-co-simulation-toolbox

Hello everyone!

I am using EnergyPlus to model a cold room, and I am using the EnergyPlus-co-simulation-toolbox to connect it with MATLAB.

I have trouble understanding when it comes to the "Key Value".

To configure the data mapping between EnergyPlus and the external interface, we have to create an XML file (called variables.cfg) in which we declare the variables that the external interface sends or reads. For reading data, the "variable source" is set “EnergyPlus", because they are computed by EnergyPlus, "EnergyPlus name" should be set to the zone name "ZoneName" which is the "Key Value" in the Output:Variable object, while "type" should be the variable name "Zone Outdoor Air Drybulb Temperature", as shown below.

<variable source = "EnergyPlus">
<EnergyPlus name = "ZoneName" type= "Zone Outdoor Air Drybulb Temperature"/>
</variable >

Output:Variable,
    ZN,                                       !- Key Value 
    Zone Outdoor Air Drybulb Temperature,     !- Variable Name
    Timestep;                                 !- Reporting Frequency

I have learned that the "Key Value" is not always the zone name. I found an example in "ExternalInterfacesApplicationGuide" in which they defined the ExternalInterface:Schedule as an Output variable and the key value was the ExternalInterface:Schedule name, as shown below

ExternalInterface:Schedule ,
     TSetCoo ,         !- Name 
     Temperature ,     !- ScheduleType 
     24;               !- Initial value , used during warm-up

Output:Variable ,
     TSetCoo ,              !- Key Value
     Schedule Value ,       !- Variable Name
     TimeStep;              !- Reporting Frequency

My question is, what is the appropriate "Key value" to use if I want to read the Output variable "Refrigeration Air Chiller System Total Compressor Electric Power" ?

I hope I explained the problem clearly.

Variable Key Value - External Interface - EnergyPlus-co-simulation-toolbox

Hello everyone!

I am using EnergyPlus to model a cold room, and I am using the EnergyPlus-co-simulation-toolbox to connect it with MATLAB.

I have trouble understanding when it comes to the "Key Value".

To configure the data mapping between EnergyPlus and the external interface, we have to create an XML file (called variables.cfg) in which we declare the variables that the external interface sends or reads. For reading data, the "variable source" is set “EnergyPlus", because they are computed by EnergyPlus, "EnergyPlus name" should be set to the zone name "ZoneName" which is the "Key Value" in the Output:Variable object, while "type" should be the variable name "Zone Outdoor Air Drybulb Temperature", as shown below.

<variable source = "EnergyPlus">
<EnergyPlus name = "ZoneName" type= "Zone Outdoor Air Drybulb Temperature"/>
</variable >

Output:Variable,
    ZN,                                       !- Key Value 
    Zone Outdoor Air Drybulb Temperature,     !- Variable Name
    Timestep;                                 !- Reporting Frequency

I have learned that the "Key Value" is not always the zone name. I found an example in "ExternalInterfacesApplicationGuide" in which they defined the ExternalInterface:Schedule as an Output variable and the key value was the ExternalInterface:Schedule name, as shown below

ExternalInterface:Schedule ,
     TSetCoo ,         !- Name 
     Temperature ,     !- ScheduleType 
     24;               !- Initial value , used during warm-up

Output:Variable ,
     TSetCoo ,              !- Key Value
     Schedule Value ,       !- Variable Name
     TimeStep;              !- Reporting Frequency

My question is, what is the appropriate "Key value" to use if I want to read the Output variable "Refrigeration Air Chiller System Total Compressor Electric Power" ?

I hope I explained the problem clearly.