Welcome to the TRNSYS Users Forum.

The forum is a place where people can interact and have discussions about different topics involving the use of the TRNSYS software package. Here you can post topics for discussion or questions on using TRNSYS and get advice from other users or TRNSYS experts. This forum is not intended for detailed technical support. Users should contact their distributor’s hotline for such assistance.

Some tips for success on using the forum:

  • Follow the Forum Rules posted in Forum Administration.
  • There are categories for different types of topics and questions. Post your topic or question into the proper category.
  • Before posting a topic or question search the existing topics  (and the TRNSYS Users listserv archive or Post archive) to see if a similar topic or question has already been answered.
  • Use a descriptive topic name. Don’t use attention getting subjects, they don’t get attention and only annoy people.
  • State the version of TRNSYS and which add-ons your are using.
  • Include enough specific details for your topic of question to be answered. Just posting “Why am I getting an error?” without describing the specific error and what you are trying to do when you get the error will not receive a response that fixes your issue.
  • Remember when people help you, they are doing you a favor. Be patient, help people out by posting good descriptions of what you need help with, and be polite even if a response does not solve your issue.
  • Moderators may edit your post for clarity or move your topic to a more appropriate category.

Notifications
Clear all

Recompile Type written in C++

10 Posts
3 Users
0 Reactions
202 Views
0
Topic starter

Hi,

I have come across a Type written by someone else in C++ and would like to use it. 
When trying to use it, I get the error that the Type could not be located in the TRNdll64.dll.
So far I have only use the TypeStudio and written new Types in Fortran 90. Therefore I don't know how to compile the Type and add it to the TRNdll64.

I'd be glad if someone could assist me on how to proceed.

Best regards
Jan

 

1 Answer
0

@janboettner

There is some demonstration of how to compile a (Fortran) user Type within the main TrnDll64.dll in this video: Debugging Errors in TRNSYS Using Visual Studio.  You'll need the Microsoft Visual Studio development environment and the Intel Visual Fortran compiler to follow along; both are free to download, and instructions to install them are included in one of the first (chronological) comments on the video. I suspect it may not work to compile a C++ Type within TRNDll.dll, but I've never tried. 

 

There is also some guidance on programming C++ Types at the end of the ProgrammersGuide.pdf in the Documentation folder of your main TRNSYS directory. It only addresses programming the Type, not compiling it, but it is there as a reference. 

 

Unfortunately I've never written and compiled a Type in C++, so I can't provide much practical guidance beyond than the TRNSYS documentation.

 

janboettner Topic starter 28/10/2024 9:48 am

@a_weiss Thank you for your reply. Unfortunately we don't have access to Visual Studio at the moment.

DavidBradley 28/10/2024 3:44 pm

@janboettner just in case you were not aware, both Visual Studio, the C++ compiler and the Intel Fortran compiler are all free. If you are using Trnsys18 you'll need to use Visual Studio 2019 and the compilers that go along with it. I don't have any experience with the C++ compiler but if you are using the Intel Fortran compiler in Visual Studio then there are a few things you must do during installation:
1. when installing Visual Studio, select the "desktop development with C++ component," which is not selected by default.
2. after installing Visual Studio, install the add-on HPC base toolkit
3. lastly, install the add-on oneAPI toolkit (this is the installer that actually includes the fortran compiler)
best,
David

janboettner Topic starter 29/10/2024 6:50 am

@DavidBradley thanks for the reply. I am aware, that there is a free version of Visual Studio. Unfortunately I can't just use it at work, due to restrictions. I am in contact with IT an looking for a solution, but it's difficult... 😀

Share: