<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello everyone,<br>
<br>
I'd like to write a simple component for TRNSYS 17 to write some
output into a file, just for getting familiar with TRNSYS component
development. I used the Simulation Studio to create a code skeleton,
where I have added the folowing code lines:<br>
<br>
<small>!Do Any Last Call Manipulations Here<br>
If(getIsLastCallofSimulation()) Then<br>
<br>
logical_unit = NINT(getParameterValue(1)) !get the logical
unit; logical_unit is the first parameter<br>
filePath = getLUFileName(logical_unit) !get the file by
logical unit<br>
<br>
CLOSE(unit=logical_unit) <br>
<br>
OPEN(unit=logical_unit,file=filePath,access='append'&<br>
,status='old',action='write') !reopen the file<br>
<br>
<br>
write(logical_unit,*) 'hello world' !just a simple test<br>
<br>
CLOSE(unit=logical_unit) <br>
<br>
Return<br>
EndIf<br>
<br>
<big>It is no problem to compile the code (using Intel Visual
Fortran Compiler 11.1 and Visual Studio 2008), but I got the
runtime error: severe(46) inconsistent OPEN/CLOSE parameters,
...<br>
Without the action parameter in the OPEN statement I got the
runtime error: severe(47): write to a READONLY file,...<br>
<br>
Has anyone an idea how to solve this problem or how to write a
Component to write output into a file?<br>
<br>
Thanks and best regards <br>
Sven<br>
</big></small><br>
<pre class="moz-signature" cols="72">--
Sven Böttcher
Dipl.-Inf.
Wissenschaftlicher Mitarbeiter
Technische Universität Dortmund
Fakultät Architektur und Bauingenieurwesen
Lehrstuhl Klimagerechte Architektur
Baroper Straße 301
D-44227 Dortmund
Fon +49(0) 231 755 5248
Mobil +49(0) 179 755 04 09
Fax +49(0) 231 755 5423</pre>
</body>
</html>