[TRNSYS-users] Writing to a file at the end of a simulation
mcdowell at tess-inc.com
mcdowell at tess-inc.com
Thu Feb 11 13:45:43 PST 2016
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 at uni.li, www.uni.li [2]
>
> Bleiben wir in Verbindung:
> Facebook [3] | YouTube [4] | Twitter [5] | LinkedIn [6]
>
> _______________________________________________
> TRNSYS-users mailing list
> TRNSYS-users at lists.onebuilding.org
> http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org [1]
Links:
------
[1]
http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org
[2] http://www.uni.li
[3] https://www.facebook.com/uni.li
[4] http://www.youtube.com/user/UniLiechtenstein
[5] https://twitter.com/uni_li
[6] http://www.linkedin.com/company/universit-t-liechtenstein/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20160211/d1e2d715/attachment-0003.htm>
More information about the TRNSYS-users
mailing list