[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TRNSYS-users] Writing to a file at the end of a simulation



Jörn -

If you use the FILES keyword for assigning the name of the file, then you can use the getExtFilePath to get the file name, open the file and then write to the file.

! getExtFilePath: Returns information about external file "fileNum" that has been referenced by
!  UNIT "unitNum" using the FILES keyword in the input file. The argument "extFilePath" is set to
!  the full path and name of the external file. The function return value is the length of the
!  variable needed to contain the file name. This function is intended primarily for components
!  written in C and C++.
Function getExtFilePath(unitNum,fileNum,extFilePath)

Regards,

Tim

---
Timothy P. McDowell Executive Vice President Thermal Energy System Specialists, LLC 22 N Carroll St, Suite 370 Madison, WI 53703 608-274-2577

On 2016-02-02 09:20, von Grabe Jörn wrote:

Dear all,

 

I am currently writing a user type which needs to create a xxx.txt file at the end of the simulation containing some information that was created during the simulation. I assume that, when creating the according component, I can use the FILES tab to define the write path (or have the user define it). However, I do not know how to get access to this information in my C++ code. There is some “getlistingfilelogicalunit” function in the Trnsys header, but I have no clue how to use it. Is there any documentation or simple example available?

 

I appreciate your help!

All the best

Jörn

 

Dr.-Ing. Jörn von Grabe, M.Sc.
Wissenschaftlicher Mitarbeiter und Postdoktorand

Universität Liechtenstein
Institut für Architektur und Raumentwicklung
Fürst-Franz-Josef-Strasse, 9490 Vaduz, Liechtenstein
Telefon +423 265 11 11, Direkt +423 265 11 39
joern.vgrabe@uni.li, www.uni.li

Bleiben wir in Verbindung:
Facebook | YouTube | Twitter | LinkedIn
 


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