[TRNSYS-users] random error when using Type155

-- Fed -- thunderfactory at hotmail.it
Tue Jul 7 00:20:08 PDT 2015


i think i found the problem, even though i do not understand it properly. I had these lines in the program:
fid=fopen('outputfile.txt','a');fprintf(fid,'1) Beginning of time (t=%.1f);\n%f\n',trnTime);fprintf(fid,'%.2f\n',trnInputs(2));
looping everytime. 'a' mode in fopen (creates or open a file and append to the already existing content). TRNSYS code was running for 1-2 times and then crashing in the middle of any additional simulation. Like it was kind of "overflow" in the output file, although it is not significantly big.
now i open the file only once in 'w+' mode in the section 
if ((trnInfo(7)==0) && (trnTime-trnStartTime<1e-6) )        fid1=fopen('CheckFile.txt','w+');end'
and then write on it an any trnsys call. the problems seems to be fixed ;-)
Thanks anyway
Federico
Date: Mon, 6 Jul 2015 10:07:03 -0500
From: d.bradley at tess-inc.com
To: trnsys-users at lists.onebuilding.org; thunderfactory at hotmail.it
Subject: Re: [TRNSYS-users] random error when using Type155


  
    
  
  
    It sounds a little bit as though some other program is performing an
    action that causes the Windows "current directory" to change in the
    middle of your simulation. I have not heard anyone else reporting
    such behavior and I am afraid that I don't have any suggestions for
    how to work around it except to try and close down as many other
    programs as possible and perhaps even disconnect from the internet
    before running the simulation just to see if that solves the
    problem.

    kind regards,

     David

    

    

    On 07/06/2015 02:17, -- Fed -- wrote:

    
    
      
      Hi everyone,
        i am using Type 155 to make a trnsys file interact with a
          matlab script, but i get a really weird and random error.
        I make the trnsys file run and usually it works without
          problems. i make it run another couple of times and still
          works, but at some point, after 2/3 runs the file crashes
          immediately and returns the  error "Error(s) in calling the
          M-File" with no other info.
        I need to close and restart
            trnsys to make it work again. Has anyone experienced the problem and knows how to
            solve it?
        thank you in advance!
      
      

      
      

      _______________________________________________
TRNSYS-users mailing list
TRNSYS-users at lists.onebuilding.org
http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org

    
    

    -- 
***************************
David BRADLEY
Principal
Thermal Energy Systems Specialists, LLC
22 North Carroll Street - suite 370
Madison, WI  53703 USA

P:+1.608.274.2577
F:+1.608.278.1475
d.bradley at tess-inc.com

http://www.tess-inc.com
http://www.trnsys.com 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20150707/cf9361dc/attachment.htm>


More information about the TRNSYS-users mailing list