[TRNSYS-users] Using storage array in TRNSYS Type written C++

HU Wen wen.hu at sitbat.com
Sun Jul 13 04:54:08 PDT 2008


Hello,

 

I have just discovered a bug with TRNSYS.h head file bundled with TRNSYS 16
in the following folders

 

..\TRNSYS\Compilers\Cpp-Mvs2003\Include

..\TRNSYS\SourceCode\Templates

 

In this file, you will find the setStorageVars and GetStorageVars
declaration:

 

extern "C" __declspec(dllimport)   void _cdecl SETSTORAGEVARS(int*
STORE_IN,int* NSTORE,int info[]);

extern "C" __declspec(dllimport)   void _cdecl GETSTORAGEVARS(int*
STORE_OUT,int* NSTORE,int info[]);

 

which should be modified as following, in my opnion

 

extern "C" __declspec(dllimport)   void _cdecl SETSTORAGEVARS(double
STORE[], int* NSTORE,int info[]);

extern "C" __declspec(dllimport)   void _cdecl GETSTORAGEVARS(double
STORE[], int* NSTORE,int info[]);

 

because the passage variable STORED or STORE is declared as double precision
array in the Fortran subroutine storage.for. 

 

Here I enclosed an example in PDF format for using this storage array in
TRNSYS Type written in C/C++. This CPP file can be easily compiled by the
free version Visual Studio/C++ Express 2003 or 2005 or 2008 with Windows
Platform SDK SP2/R2. 

 

With my best regards,

 

Wen HU   Ph.D

Thermal Science Engineer

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20080713/ebe0b2e1/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Type234Cpp_Listing_Deck.pdf
Type: application/pdf
Size: 21546 bytes
Desc: not available
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20080713/ebe0b2e1/attachment-0001.pdf>


More information about the TRNSYS-users mailing list