<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:358700411;
        mso-list-type:hybrid;
        mso-list-template-ids:457465700 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi and thanks to both for the feedback.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I have kept my other version of 64-bit Matlab but I removed it from the path, and only kept the Matlab 2012b in that path.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Now the example Calling_Matlab does work well. I also suggest for Windows 7 users to be careful with the Windows path: in the environment variables dialogue box, there are two variables called ‘Path’, and it
 is the system one that should be changed.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thibault<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span style="color:windowtext"> David BRADLEY [mailto:d.bradley@tess-inc.com]
<br>
<b>Sent:</b> Tuesday, February 27, 2018 15:47<br>
<b>To:</b> TRNSYS users mailing list at OneBuilding.org <trnsys-users@lists.onebuilding.org><br>
<b>Cc:</b> Thibault Péan <tpean@irec.cat><br>
<b>Subject:</b> Re: [TRNSYS-users] Type155 with different versions of Matlab<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Thibault,<span style="font-size:12.0pt"><o:p></o:p></span></p>
<p> All of Simon's comments are relevant. Two other important notes <o:p></o:p></p>
<p>- make sure that your user account and the built-in SYSTEM account both have administrator access on the computer.<o:p></o:p></p>
<p>- make sure that the path to Matlab's bin\win32 directory in the Windows environment path is the
<i>only </i>reference to Matlab that appears in the path. Sometimes users have found problems if both Matlab 64-bit and Matlab 32-bit are referenced in the path.<o:p></o:p></p>
<p>kind regards,<o:p></o:p></p>
<p> David<o:p></o:p></p>
<p><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 02/27/2018 06:21, Thibault Péan via TRNSYS-users wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Dear TRNSYS users,<o:p></o:p></p>
<p class="MsoNormal">I am trying to call Matlab from TRNSYS using the Type155.<o:p></o:p></p>
<p class="MsoNormal">I am using TRNSYS 17.02.0004, and Matlab 2016a (64-bit), on Windows 7 64-bit machine. It seems that with TRNSYS 17 it is not possible to call a 64-bit version of Matlab, therefore I followed the following steps:<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">      
</span></span><![endif]>Install Matlab 2012b 32-bit (a version for which the configured Type155 is available)<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">      
</span></span><![endif]>Extracted the Type155.dll for Matlab2012b, from the folder “C:\Trnsys17\Exe\DLLs”, and copied the file in “C:\Trnsys17\Exe”<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">3.<span style="font:7.0pt "Times New Roman"">      
</span></span><![endif]>Added the folder “C:\Program Files (x86)\MATLAB\R2012b\bin\win32” to Windows search path<o:p></o:p></p>
<p class="MsoNormal">I got these insights from a conversation on this topic here:
<a href="https://www.researchgate.net/post/Problem_calling_matlab_with_TRNSYS_17">
https://www.researchgate.net/post/Problem_calling_matlab_with_TRNSYS_17</a> <o:p>
</o:p></p>
<p class="MsoNormal">However, I still can’t get it to work, and I get the error: <i>
“Your input file uses Type 155 (Calling Matlab). "Type155.dll" was found but could not be loaded. Please make sure that a supported version of Matlab is installed and that Matlab's "bin\win32" folder is on Windows' search path”</i><o:p></o:p></p>
<p class="MsoNormal">Am I missing something? Anything to do with the .lib files? Or should I try a different version of Matlab than the 2012b?<o:p></o:p></p>
<p class="MsoNormal">I also saw that if I upgrade to TRNSYS 18, the compatibility with 64-bit versions of Matlab is supported, so I might as well try that (but I am a bit scared that my existing projects in TRNSYS 17 will crash in TRNSYS 18…). The conversation
 was here:<o:p></o:p></p>
<p class="MsoNormal"><a href="http://lists.onebuilding.org/htdig.cgi/trnsys-users-onebuilding.org/2017-May/029030.html">http://lists.onebuilding.org/htdig.cgi/trnsys-users-onebuilding.org/2017-May/029030.html</a><o:p></o:p></p>
<p class="MsoNormal">Thanks, any help would be welcome.<o:p></o:p></p>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><b>Thibault Péan</b><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:6.0pt"><i><span style="color:gray">PhD Candidate</span></i><o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td width="511" valign="top" style="width:383.25pt;border:none;border-top:solid windowtext 1.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-top:6.0pt"><span style="font-size:9.0pt">INCITE – Innovative Controls For Renewable Source Integration Into Smart Energy Systems</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.0pt">IREC – Catalonia Institute for Energy Research</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.0pt">UPC – Polytechnic University of Catalonia</span><o:p></o:p></p>
</td>
<td width="127" valign="top" style="width:95.55pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><a href="http://www.incite-itn.eu/"><span style="color:#1F497D;text-decoration:none"><img border="0" width="113" height="36" id="Picture_x0020_1" src="cid:image001.png@01D3B077.028D2E40" alt="Descripción:
                        C:\Users\tpean\Desktop\logo.png"></span></a><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>TRNSYS-users mailing list<o:p></o:p></pre>
<pre><a href="mailto:TRNSYS-users@lists.onebuilding.org">TRNSYS-users@lists.onebuilding.org</a><o:p></o:p></pre>
<pre><a href="http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org">http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><br>
<br>
<o:p></o:p></span></p>
<pre>-- <o:p></o:p></pre>
<pre>***************************<o:p></o:p></pre>
<pre>David BRADLEY<o:p></o:p></pre>
<pre>Principal<o:p></o:p></pre>
<pre>Thermal Energy Systems Specialists, LLC<o:p></o:p></pre>
<pre>22 North Carroll Street - suite 370<o:p></o:p></pre>
<pre>Madison, WI  53703 USA<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>P:+1.608.274.2577<o:p></o:p></pre>
<pre>F:+1.608.278.1475<o:p></o:p></pre>
<pre><a href="mailto:d.bradley@tess-inc.com">d.bradley@tess-inc.com</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><a href="http://www.tess-inc.com">http://www.tess-inc.com</a><o:p></o:p></pre>
<pre><a href="http://www.trnsys.com">http://www.trnsys.com</a><o:p></o:p></pre>
</div>
</body>
</html>