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

Variable Key Value - External Interface - EnergyPlus-co-simulation-toolbox [closed]

asked 2023-06-26 01:40:49 -0500

Zakaria's avatar

updated 2023-06-29 14:44:17 -0500

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.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Zakaria
close date 2024-01-28 06:11:54.548063

2 Answers

Sort by » oldest newest most voted
2

answered 2023-07-03 03:43:34 -0500

Zakaria's avatar

I discovered that the "key value" should be the name of the "Object" linked to it.

For example "Zone Outdoor Air Drybulb Temperature" is related to the "Zone Object", so the "key value" = "Zone name".

In my scenario, the output variable is "Refrigeration Air Chiller System Total Compressor Electric Power", which is related to the "Compressor Object". Therefore, the "key value" would be the "Compressor Name"

edit flag offensive delete link more
1

answered 2023-06-28 10:12:38 -0500

If you use an asterisk (*) as the Key Value, the output will include all possible E+ objects (Key Values) that the output variable pertains to. Then you can filter down to a single E+ object if that's your interest.

Alternatively, you can search for the output variable in the E+ Input/Output Reference documentation and see what E+ object it applies to.

edit flag offensive delete link more

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2023-06-26 01:40:49 -0500

Seen: 99 times

Last updated: Jul 03 '23