<div>As we all konwn,The computer engine of eQuest software is DOE2.2. you can program your computer  to accomplish  this function using C or VB program language.Blow is the specification for calling DOE2.2.</div><div><br></div><div><div>   (c) Copyright 1999, Scott A. Criswell.  All Rights Reserved.</div><div><br></div><div>This file describes how to interface with the D2Result DLL in</div><div>order to retrieve simulation results from the DOE-2.2 binary</div><div>results files.  </div><div><br></div><div><br></div><div>----------------------------------------------------------------------</div><div>UPDATES:</div><div>----------------------------------------------------------------------</div><div> 8/31/99 - SAC - VisualBasic Users - We have added VB-compatible versions</div><div>                 of each of the rest of the functions exported from the</div><div>                 D2Result.dll.  Your VB code should use the same arguments,</div><div>                 but the function names should be *_VB*().  For example,</div><div>                 instead of calling D2R_GetMultipleResult(...), you</div><div>                 should call D2R_VBGetMultipleResult(...).</div><div> 8/22/99 - SAC - VisualBasic Users - We have added a function call</div><div>                 which is equivalent to D2R_GetSingleResult() but uses</div><div>                 a calling convention compatible with VisualBasic.</div><div>                 This new function is called D2R_VBGetSingleResult()</div><div>                 and takes the exact same arguments as its counterpart.</div><div>                 No such VB-compatible D2R_GetMultipleResult() counter-</div><div>                 part exists.  Please contact us if you would like one</div><div>                 added.</div><div>----------------------------------------------------------------------</div><div><br></div><div><br></div><div>Results retrieval is current available only from the Non-Hourly</div><div>results files for Loads, HVAC and Economics.</div><div><br></div><div>The D2Result.DLL library is based on MFC (Microsoft Foundation</div><div>Classes) and therefore requires that the following files be</div><div>installed into your Windows\System directory:</div><div>   MFC42.DLL   (~975 kb)</div><div>   MSVCRT.DLL  (~250 kb)</div><div>You can find these files located in the \System directory of</div><div>this distribution.</div><div>These files are the latest updates that are reported to be</div><div>fully compatible with previous versions.  However, we do</div><div>recommend that you save older versions of these files in the</div><div>event these new files are incompatible with other software</div><div>running on your machine.</div><div><br></div><div>Unlike interfacing with the BDLCIO32 and SimCIO32 DLLs, the</div><div>D2Result DLL does not interface directly with any other </div><div>executable code.  As a result, there are no DLL initialization</div><div>or clean-up routines.  The only things you need do are to load</div><div>and unload the DLL using whatever mechanism is available to</div><div>your in your development environment and to call the various</div><div>exported functions much like you would any other DLL you</div><div>interface with.</div><div><br></div><div>The following is a description of the functions exported from</div><div>D2Result.DLL:</div><div>(for more details, refer to the D2ResX.h header file and the</div><div> top portion ofthe NHRList.txt file)</div><div><br></div><div>1) Retrieval of a single value or array of values:</div><div>      long D2R_GetSingleResult( const char* pszDOE2Dir,</div><div>                                const char* pszFileName,</div><div>                                int iEntryID,</div><div>                                float* pfData,</div><div>                                int iMaxValues,</div><div>                                const char* pszReportKey,</div><div>                                const char* pszRowKey );</div><div><br></div><div>      Return Value:</div><div>            >= 0 => successful - # of values retrieved</div><div>            <  0 => failed - refer to the D2ResX.h header file for</div><div>                    descriptions of the various return values.</div><div><br></div><div>      Where:</div><div>         pszDOE2Dir   => Directory where DOE-2 system files (such as</div><div>                         BDLKey.bin, BDLLib.dat, etc.) are stored</div><div>                         (including a trailing '\').</div><div>         pszFileName  => The full path and filename of the BDL input</div><div>                         file without the trailing dot or file</div><div>                         extension.</div><div>                         (i.e. if your DOE-2 input filename is:</div><div>                          "C:\My Dir\Projects\Wall Mart\Wall Mart.inp"</div><div>                          then pszFileName should be:</div><div>                          "C:\My Dir\Projects\Wall Mart\Wall Mart")</div><div>         iEntryID     => Integer value identifying the value or series</div><div>                         to be retrieved.  These values are defined in</div><div>                         the first column of DOE-2\NHRList.txt file.</div><div>         pfData       => Address of an array of 32-bit floating point</div><div>                         numbers to be populated with results.</div><div>         iMaxValues   => Number of floats defined in above array.</div><div>                         (this value should correspond to the value</div><div>                          in the "NI" column of the NHRList.txt entry</div><div>                          describing the result(s) you are retrieving)</div><div>         pszReportKey => Used only when retrieving results from a</div><div>                         non-hourly report which is repeated over</div><div>                         multiple components of a particular type.</div><div>                         This argument contains a NULL-terminated</div><div>                         character string identifying the building</div><div>                         component for which you are retrieving the</div><div>                         results.</div><div>                         This argument must contain a valid string</div><div>                         whenever the "RI" column of the selected</div><div>                         NHRList.txt data contains a value > 0.</div><div>         pszRowKey    => Used only when retrieving results from a</div><div>                         report which contains multiple rows of data</div><div>                         where each row provides results for a separate</div><div>                         building component or month of the year.</div><div>                         This argument contains a NULL-terminated</div><div>                         character string identifying the row of data</div><div>                         which you are retrieving the results for.</div><div>                         This argument must contain a valid string</div><div>                         whenever the "KT" column of the selected</div><div>                         NHRList.txt data contains a value > 0.</div><div><br></div><div>      Example:</div><div>         To retrieve the total site energy use for a building (from the</div><div>         BEPS report):</div><div>            To determine iEntry, open the NHRList.txt file and search</div><div>            for "BEPS" to find: "2001   BEPS  Building Energy..."</div><div>            The "2001" is the first four digits of the iEntryID, then</div><div>            we do another search for "2001   BEPS" to get down to the</div><div>            area where the BEPS report entries are defined.  Once there</div><div>            we examine the text to the far right of each entry which</div><div>            provides a description of the results which that entry</div><div>            retrieves data for.  We find that the entry ID 2001001</div><div>            retrieves "Total Site Energy (BTU)".</div><div><br></div><div>            Here's what the call looks like (in 'C'):</div><div><br></div><div>               float fResult;</div><div>               long lRetVal = D2R_GetSingleResult(</div><div>                                 "E:\\WinDOE2\\doe-2\\",</div><div>                                 "E:\\WinDOE2\\Projects\\Proj1\\Proj1",</div><div>                                 2001001, &fResult, 1, NULL, NULL );</div><div><br></div><div><br></div><div>2) When retrieving mutliple single values or arrays of results from the</div><div>   same Non-Hourly results file, it is most efficient to use a different</div><div>   function in order to retrieve all the results at once:</div><div><br></div><div>      long D2R_GetMultipleResult( const char* pszDOE2Dir,</div><div>                                  const char* pszInpFileName,</div><div>                                  int iFileType,</div><div>                                  float* pfData,</div><div>                                  int iMaxValues,</div><div>                                  int iNumMRTs,</div><div>                                  MultResultsType* pMRTs );</div><div><br></div><div>      Return Value:</div><div>            >= 0 => successful - # of values retrieved</div><div>            <  0 => failed - refer to the D2ResX.h header file for</div><div>                    descriptions of the various return values.</div><div><br></div><div>      Where:</div><div>         pszDOE2Dir   => Directory where DOE-2 system files (such as</div><div>                         BDLKey.bin, BDLLib.dat, etc.) are stored</div><div>                         (including a trailing '\').</div><div>         pszFileName  => The full path and filename of the BDL input</div><div>                         file without the trailing dot or file</div><div>                         extension.</div><div>                         (i.e. if your DOE-2 input filename is:</div><div>                          "C:\My Dir\Projects\Wall Mart\Wall Mart.inp"</div><div>                          then pszFileName should be:</div><div>                          "C:\My Dir\Projects\Wall Mart\Wall Mart")</div><div>         iFileType    => 0 for Loads results, 1 for HVAC and simulated</div><div>                         Energy Use results and 2 for Utility Rate and</div><div>                         Economics results.  This value should also</div><div>                         correspond to the first digit of each NHRList</div><div>                         entry ID minus 1.</div><div>         pfData       => Address of an array of 32-bit floating point</div><div>                         numbers to be populated with ALL single or</div><div>                         arrays of results.</div><div>         iMaxValues   => Number of floats defined in above array.</div><div>         iNumMRTs     => Number of MultResultsType structures pointed</div><div>                         to by the following argument.  Only the first</div><div>                         12 will be used, each one must retrieve results</div><div>                         from the same file and the number of items</div><div>                         retrieved for each element should be equal.</div><div>         pMRTs        => Pointer to an array of MultResultsType</div><div>                         structures:</div><div>                            struct MultResultsType</div><div>                            {</div><div>                               int  iEntryID;      // from NHRList.txt</div><div>                               int  iReturnValue;  // success/failure</div><div>                               char pszReportKey[ 34 ];</div><div>                               char pszRowKey[    34 ];</div><div>                            };</div><div><br></div><div><br></div><div>      Example:</div><div>         To retrieve the energy use by end-use and the end-use sum for</div><div>         a series of electric meters (EM1 and EM2) from the PS-F reports</div><div>         followed by the sum across all electric meters by end-use from</div><div>         the PS-E reports:</div><div><br></div><div>            MultResultsType MRTs[4];</div><div><br></div><div>            MRTs[0].iEntryID = 2309007;    // EM1 array from PS-F</div><div>            MRTs[0].pszReportKey = "EM1";</div><div>            MRTs[0].pszRowKey[0] = '\0';</div><div><br></div><div>            MRTs[1].iEntryID = 2309007;    // EM2 array from PS-F</div><div>            MRTs[1].pszReportKey = "EM2";</div><div>            MRTs[1].pszRowKey[0] = '\0';</div><div><br></div><div>            MRTs[2].iEntryID = 2305005;    // Elec Mtr Totals from PS-E</div><div>            MRTs[2].pszReportKey[0] = '\0';</div><div>            MRTs[2].pszRowKey[0]    = '\0';</div><div><br></div><div>            float fResults[39];  // 3 MRTs x 13 values per MRT</div><div>            long lRetVal = D2R_GetMultipleResult(</div><div>                                 "E:\\WinDOE2\\doe-2\\",</div><div>                                 "E:\\WinDOE2\\Projects\\Proj1\\Proj1",</div><div>                                 1, fResults, 39, 3, MRTs );</div><div><br></div><div><br></div><div>3) Additional functions exist enabling you to determine how many</div><div>   building components of a particular type were defined in the</div><div>   input file corresponding to the results you are retrieving as</div><div>   well as the name of each of those components.  These functions</div><div>   enable you to retrieve results for particular building components</div><div>   when you are not sure what the component names were in the</div><div>   original BDl input.</div><div>   Refer to the function definitions in the D2ResX.h header file for</div><div>   more details.</div></div><div><br></div><div><br></div><div>Best regard</div><div><br></div><div>赵永青</div><div><br></div><div>长沙绿建节能科技有限公司</div><div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b> "Yf Sun"<caselysun@gmail.com>;</div><div><b>发送时间:</b> 2013年5月22日(星期三) 上午10:07</div><div><b>收件人:</b> "tiejun hu"<hutiejun1223@126.com>; <wbr></div><div><b>抄送:</b> "equest-users"<equest-users@lists.onebuilding.org>; <wbr></div><div><b>主题:</b> Re: [Equest-users] Is there a way to extract specific data from simresult?</div></div><div><br></div><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi, tiejun!</span><div style="font-family:arial,sans-serif;font-size:13px">Thanks for your reply but I dont need the hourly data, i need annual system peak loads, cooling and heating system loads for example, do you have a idea how to automate the data extraction?</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 22, 2013 at 10:05 AM, Yf Sun <span dir="ltr"><<a href="mailto:caselysun@gmail.com" target="_blank">caselysun@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, tiejun!<div>Thanks for your reply but I dont need the hourly data, i need annual system peak loads, cooling and heating system loads for example, do you have a idea how to automate the data extraction?</div>

</div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Wed, May 22, 2013 at 9:51 AM, tiejun hu <span dir="ltr"><<a href="mailto:hutiejun1223@126.com" target="_blank">hutiejun1223@126.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;font-size:14px;font-family:arial"><div>Hi,Yf</div>
<div>    You can creat hourly reports in detail mode, then run it, open hourly reports in sim file.</div>
<div>    Best regards<br><br><br><br><br></div><div><div>
<div></div>
<div></div>
<div><br></div>At 2013-05-22 09:48:23,"Yf Sun" <<a href="mailto:caselysun@gmail.com" target="_blank">caselysun@gmail.com</a>> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex">
<div dir="ltr">Hi,dear Equesters!<br clear="all">
<div>Im currently doing my ph.d research using equest to analyse building energy performance, i found its time consuming to find the data i need from sim result, as the data i need almost the same for every simulation, do you know a way to extract the specific text data(for importing to excel) quickly by using some third party program maybe?</div>


<div><br></div>
<div>-- </div>
<div dir="ltr">
<div>Best regards<br></div>
<div>Ivan</div></div></div></blockquote></div></div></div><br><br><span title="neteasefooter"><span></span></span></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>
<div dir="ltr"><div>Best regards<br></div><div>
孙一峰</div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Best regards<br></div><div>孙一峰</div></div>
</div></div>