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

Re: [TRNSYS-users] Run time error - Unit-1 file CONOUT$



Edward,

Yes, it was due to the WRITE statement present in my DLL. I included this WRITE
instruction previously for checking my program outside the TRNSYS. Before I
made modification, my program had always run succesfully. I suspect therefore
there is something wrong with my modification which the program reports as
error by attempting to display a message in the screen and causes the run time
error. I'm now rechecking my modification.

While I'm checking this bug, it would be worthwhile if you could tell me how to
transfer the ERROR CHECKING to TRNSYS, so that I can avoid the WRITE statement
in my DLL. In DLL "template" provided, no mention of such ERROR CHECKING. The
main reason why I decided to write my subroutine as DLL (as opposed to ordinary
TYPE in TRNSYS) is because the DLL "template" provided is easier for me to
follow than the ordinary TYPE "template". [FYI: Previously I wrote my program
in VB, then transferred it to Visual C/C++, and finally to FORTRAN, due to the
fact that my previous attempts to create my DLL in VB & C/C++ and made it a
TNRSYS component, failed].

Writing a "normal" Fortran Type looks much easier to me than having it in an external DLL. I suggest that you start from an existing Type or from the skeleton generated by IIsiBat, and then use the instruction on the website on how to recompile trnlib.dll (http://sel.me.wisc.edu/trnsys/ , then "Fortran Info")


I'm also trying to convert my DLL to ordinary TYPE subroutine, but I always get
the message something like: YOU ATTEMPT TO CALL A SUBROUTINE WHICH HAS NOT BEEN
LINKED ...

If this is a TRNSYS error message (and not a compiler / linker error), you may just be missing a "RETURN 1" in your component. "RETURN 1" (and not just "RETURN") tells TRNSYS to jump to the correct line when it returns from your Type and failure to do so generates an error message saying that a file was not linked. Now if it is some sort of "unresolved external" error in the compiler, you are probably calling some routines that you did not link to the project (but if you were able to link them to your external DLL, you should be able to link them to trnlib.dll as well).


Good luck,

Michaël Kummert

--
_________________________________________________________

Michaël Kummert

Solar Energy Laboratory - University of Wisconsin-Madison
1303 Engr Res Bldg, 1500 Engineering Drive
Madison, WI 53706

Tel: +1 (608) 263-1589
Fax: +1 (608) 262-8464
E-mail: kummert@xxxxxxxxxxxxx

SEL Web Site: http://sel.me.wisc.edu
TRNSYS Web Site: http://sel.me.wisc.edu/trnsys
_______________________________________________
TRNSYS-users mailing list
TRNSYS-users@xxxxxxxxxxxxx
https://www.cae.wisc.edu/mailman/listinfo/trnsys-users