[TRNSYS-users] Call external file through special cards with C++

keilholz, werner werner.keilholz at cstb.fr
Fri Jun 4 07:27:40 PDT 2010


Hi Xingbin,

 

I once proposed this solution :

https://www-old.cae.wisc.edu/pipermail/trnsys-users/2010/005500.html <https://www-old.cae.wisc.edu/pipermail/trnsys-users/2010/005500.html> 

 

It does not use the special cards, but the external file tab, like FORTRAN components. 

 

In TRNSYS 17, there is a special FILE keyword, which solves this problem. I attach a sample component with source code using it (but this requires Trnsys 17, does not work with 16).

 

Werner

 

 

De : xingbin lin [mailto:lynxingbin at gmail.com] 
Envoyé : vendredi 4 juin 2010 15:31
À : TRNSYS-users at cae.wisc.edu
Objet : [TRNSYS-users] Call external file through special cards with C++

 

Hello everyone,

 

I built a new type in which I need call external file through special cards in trnsys 16,and I exported it as C++,in this type,I wanted to get the path of external file by using the access  function getLabel(int,int) which was defined in TRNSYS.h header file.

 

But when I runned the simulation,it  prompted "Access  violation at address ###### in module 'dforrt.dll'".The function getLabel(int,int)  defined in "TRNSYS.h" is that "extern "C" __declspec(dllimport) char* _cdecl  TRNSYSFUNCTIONS_mp_GETLABEL(int , int );#define getLabel       TRNSYSFUNCTIONS_mp_GETLABEL".

 

I searched this problem in internet,somebody said maybe the reason existed in the process of calling the dll between  C++ and Fortran. 
Please tell me how can I solve this exception and any suggestions.

 

Thanks.

 

Xingbin Lin 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20100604/671f6e3c/attachment-0005.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Component1.cpp
Type: application/octet-stream
Size: 6814 bytes
Desc: Component1.cpp
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20100604/671f6e3c/attachment-0010.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Component1.tmf
Type: application/octet-stream
Size: 614 bytes
Desc: Component1.tmf
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20100604/671f6e3c/attachment-0011.obj>


More information about the TRNSYS-users mailing list