[TRNSYS-users] R: R: type 155 and GenOpt

Elisa Ghirardi elisa.ghirardi at unibg.it
Fri Jan 26 03:06:58 PST 2018


I find that GenOpt rewrite the .dck file with all capital characters, so it changed the name to m-file, this is the origin of my problem.

Thanks all for the support.

Elisa

Da: Riccardo Nesa via TRNSYS-users
Inviato: lunedì 22 gennaio 2018 15:11
A: TRNSYS users mailing list at OneBuilding.org
Cc: Riccardo Nesa
Oggetto: Re: [TRNSYS-users] R: type 155 and GenOpt

Maybe you are right;
you can read the help documentation of trnsys (mathematical reference, 4.13.20 type 155: calling matlab, pag. 451) for some clarification.
To avoid some problems i have installed matlab 2011b 32 bit with trnsys 17.
check trnsys17/exe/DLLs. there you can see the dlls for type 155. 

if you don't see your matlab version i think the software can't work.
these are what i know, let me know if you can fix it.


Da: TRNSYS-users <trnsys-users-bounces at lists.onebuilding.org> per conto di Elisa Ghirardi via TRNSYS-users <trnsys-users at lists.onebuilding.org>
Inviato: lunedì 22 gennaio 2018 14:35
A: TRNSYS users mailing list at OneBuilding.org
Cc: Elisa Ghirardi
Oggetto: [TRNSYS-users] R: type 155 and GenOpt 
 
thanks Riccardo for your reply and your help. 
Unfortunately I have already set all the mFileErrorCode like your suggestion but I still have the same error.
 
It would be an issue with a too recent version of Matlab? (I’m using a 64-bit version of Trnsys 18 (18.00.0016) with a 64-bit version of Matlab 2016a)
 
Elisa Ghirardi
 
Da: Riccardo Nesa via TRNSYS-users
Inviato: lunedì 22 gennaio 2018 12:13
A: TRNSYS users mailing list at OneBuilding.org
Cc: Riccardo Nesa
Oggetto: Re: [TRNSYS-users] type 155 and GenOpt
 
Hi elisa
 
you have to put "mFileErrorCode=some_number" in the m.file to get the point when your script fails and you MUST write "mFileErrorCode=0" at the end of the m.file.

 
 
you have to write 
 
"mFileErrorCode=0
return
"
also at the end of some particular  "if statment" like:
 
 
if trnInfo(8)==-1
...
...
...
mFileErrorCode=0
return
 
 
 
 

Da: TRNSYS-users <trnsys-users-bounces at lists.onebuilding.org> per conto di Elisa Ghirardi via TRNSYS-users <trnsys-users at lists.onebuilding.org>
Inviato: lunedì 22 gennaio 2018 09:30
A: trnsys-users at lists.onebuilding.org
Cc: Elisa Ghirardi
Oggetto: [TRNSYS-users] type 155 and GenOpt 
 
Hi TRNSYS users,
 
I’m trying to run an optimization with TrnOpt with a link with matlab (type 155). The single simulation works, but when I run the optimization I have always the same error: “The M-File did not properly set 'mFileErrorCode' to 0 when it was called. This may indicate that an error occurred in Matlab while running the M-File. 'mFileErrorCode' was left to 1 by the M-File. You can set ignoreEngineClose to 1 and run the 'lasterr' command in Matlab to help diagnose the  problem. The error occurred at info(7) =            0 , info(13) =            0”.
I think it’s a problem  with matlab file access because , despite the .m file being inserted into the GenOpt input file, the GenOpt seems unable to start it, in fact GenOpt starts matlab but then fails to open the file. 
 
Someone of you has already dealt with this issue?
 
Kind regards,
 
Elisa Ghirardi
University of Bergamo, Italy.
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20180126/efd76213/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 22B1FC193E344ED28E0C50589B5304D6.png
Type: image/png
Size: 158 bytes
Desc: not available
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20180126/efd76213/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: B0C396CA266D4805BB61D82556E4FF7E.png
Type: image/png
Size: 158 bytes
Desc: not available
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20180126/efd76213/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 10261 bytes
Desc: not available
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20180126/efd76213/attachment-0008.png>


More information about the TRNSYS-users mailing list