<html>
<body>
Marijke,<br><br>
<blockquote type=cite class=cite cite=""><font face="arial" size=2>1/I
want to call the Psychrometrics - subroutine that is already available in
Trnsys from my dll. <br>
I found some info on how to do this in the Manuel's Programmer's guide
but it is still unclear to <br>
me where in the Fortran-file i have to put these lines. I have the
temperature and relative humidity <br>
of the air as inputs but i want to calculate the wet bulb temperature and
use it in my calculations<br>
within the dll. How should i do this?</font></blockquote><br>
there should be no difference in the way that your Type (in an external
DLL) calls the psychrometrics() routine and the way that a standard Type
(in TRNDll.dll) calls the psychrometrics() routine. The two basic
arguments required by psychrometrics() are a mode switch to tell the
routine what property data you are providing and then an array that
contains that data and some space for psychrometrics to fill in the rest.
The double precision array is usually called PSYDAT() and is dimensioned
to 7 spots. One of the clearest examples of callng psychrometrics is in
Type33:<br><br>
<font size=2>C       SET UP ARRAY PSYDAT TO
GIVE INFO TO SUBROUTINE PSYCH<br>
100      PSYDAT(1) = PATM<br>
        
<x-tab>       </x-tab>PSYDAT(2) =
TDRY<br>
        
<x-tab>       </x-tab>PSYDAT(3) =
TWET<br>
        
<x-tab>       </x-tab>PSYDAT(4) =
RELHUM<br>
        
<x-tab>       </x-tab>PSYDAT(5) =
TDEW<br>
        
<x-tab>       </x-tab>PSYDAT(6) =
HUMRAT<br>
        
<x-tab>       </x-tab>PSYDAT(7) =
ENTHAL<br>
 <br>
C       DO NOT PRINT ERROR WARNINGS ON THE
FIRST CALL<br>
        
<x-tab>       </x-tab>CALL
PSYCHROMETRICS(TIME,INFO,1,MODE,WBMODE,PSYDAT,0,STATUS,*101)<br>
        
<x-tab>       </x-tab>CALL
LINKCK('TYPE 33','PSYCHROMETRICS',1,99)<br>
101      CONTINUE<br><br>
C       GET INFO FROM PSYCH<br>
        
<x-tab>       </x-tab>PATM =
PSYDAT(1)<br>
        
<x-tab>       </x-tab>TDRY =
PSYDAT(2)<br>
        
<x-tab>       </x-tab>TWET =
PSYDAT(3)<br>
        
<x-tab>       </x-tab>RELHUM =
PSYDAT(4)<br>
        
<x-tab>       </x-tab>TDEW =
PSYDAT(5)<br>
        
<x-tab>       </x-tab>HUMRAT =
PSYDAT(6)<br>
        
<x-tab>       </x-tab>ENTHAL =
PSYDAT(7)<br>
        
<x-tab>       </x-tab>RHOWM =
PSYDAT(8)<br>
        
<x-tab>       </x-tab>RHOWA =
PSYDAT(9)<br><br>
</font><blockquote type=cite class=cite cite=""><font face="arial" size=2>
2/My second question is that i need to call an external file from the dll
to choose in that file appropriate <br>
values according to an input value calculated within the dll (like
chosing a value from a table). I think <br>
calling a dynamic data can be a good way to do this. Does anyone know how
this works and where i<br>
have to put the necessary lines in my
fortran-file?</font></blockquote><br>
a call to DynamicData is useful if you need the information in your
external file to be interpolated. If that is the case, then there should
be some information in the 08 Programmer's Guide manual on how to call
DynamicData. There are also some good examples again in the code; like
with the psychrometrics() call, there is no difference between a call to
DynamicData() in the TRNDll.dll and in an external DLL. You might look at
Type71 for an example:<br><br>
<font size=2>C    USE THE DATA SUBROUTINE TO INTERPOLATE
TO FIND THE IAM FOR BEAM RADIATION<br>
     
<x-tab>  </x-tab>X(1)=THETAL<br>
     
<x-tab>  </x-tab>NXJ(1)=NXDATAL<br>
     
<x-tab>  </x-tab>X(2)=THETAT<br>
     
<x-tab>  </x-tab>NXJ(2)=NXDATAT<br>
      <x-tab>  </x-tab>CALL
DYNAMICDATA(LUDATA1,2,NXJ,1,X,Y,INFO,*821)<br>
      <x-tab>  </x-tab>CALL
LINKCK('TYPE71','DYNAMICDATA  ',1,99)<br>
821   <x-tab>  </x-tab>XKATB=Y(1)<br><br>
</font>One warning I might give is that when you are dealing with data
files that are read by external DLLs, you have to make sure that both the
TRNDll.dll and the external DLL are set to the same configuration
(release or debug). If the configurations do not match then you will get
all sorts of strange errors that will make you crazy.<br>
Cheers,<br>
 David<br><br>
<br><br>
<x-sigsep><p></x-sigsep>
****************************************************************************************<br>
Thermal Energy System Specialists (TESS), LLC <br>
David
BRADLEY                          
2916 Marketplace Drive - Suite 104 <br>
Partner                                       
Madison, WI 53719 <br>
Phone: (608) 274-2577 USA <br>
Fax: (608) 278-1475 <br>
E-mail: bradley@tess-inc.com <br>
Web Pages: 
<a href="http://www.tess-inc.com/" eudora="autourl">
http://www.tess-inc.com</a>    
and     
<a href="http://www.trnsys.com/" eudora="autourl">
http://www.trnsys.com<br><br>
</a>"Providing software solutions for today's energy engineering
projects" <br>
****************************************************************************************<br>
</body>
</html>