[TRNSYS-users] TRNSYS debug-mode and Visual Studio 2010

marcello.caciolo at cofelyaxima-gdfsuez.com marcello.caciolo at cofelyaxima-gdfsuez.com
Thu Jun 13 00:10:48 PDT 2013

Dear Florian,

In order to debug your type in Visual Studio you have two ways:

1) "official way" : you can rebuild trnDll in debug mode (don't forget before to make a backup copy of the original trnDll, which is in C:\Trnsys17\Exe), so that TRNSYS automatically uses the types in your debugDLLs folder. You should be sure that all types you use in your simulation are in this folder. After that, you can click in "Start debug" in Visual Studio (Debug menu of F5). A dialog box will open asking for an executable file to start the debugging, you should select the file C:\Trnsys17\Exe\TRNExe.exe (it is the "starting point" of a TRNSYS simulation, calling trnDll). You can ignore the dialog box which follows. If you have a breakpoint in you code, execution will stop at this point and you will be able to explore variables and debugging step-by-step (F8)

2) a shortcut to avoid rebuilding trnDll is to copy the dll of your type from debugDll to releaseDll. After that, you will follow the same procedure as in the first option (start debug and selection of C:\Trnsys17\Exe\TRNExe.exe). In this case, you have to make this copy each time you rebuild your type in order to "synchronize" your code with the executable. 

Good luck for your diploma thesis!

Marcello Caciolo
Responsable Outils et Méthodes d'Analyse Energétique

Cellule Efficacité Energétique et Environnementale - Pôle Projets et Réalisations
46 Boulevard de la Prairie au Duc
BP 40119 - 44201 Nantes Cedex 02
Tél.: +33 02 40 41 06 57
marcello.caciolo at cofelyaxima-gdfsuez.com
Pensez à l'environnement avant d'imprimer ce message

-----Message d'origine-----
De : trnsys-users-bounces at cae.wisc.edu [mailto:trnsys-users-bounces at cae.wisc.edu] De la part de Currie, Sam R
Envoyé : jeudi 13 juin 2013 04:12
À : 'TRNSYS users mailing list at the Solar Energy Lab, UW-Madison'
Objet : Re: [TRNSYS-users] TRNSYS debug-mode and Visual Studio 2010

Hi Florian,

I'm not familiar with the previous email you mentioned, so maybe if you could provide some more info on the convergence error it would help us give you specific advice.

Anyways, you shouldn't have to recompile any other types besides the one you are creating. In general, I always create both release and debug .dll files just to be safe. In Simulation Studio you can switch into Debug mode through the control cards and that should give you plenty of information in the lst file to track the error down. 

I believe there is a way to step through the simulation similar to stepping through code in VS although I'm not sure how, anyone want to weigh in here?

Sam Currie
Purdue University

-----Original Message-----
From: Schreiner, Florian [mailto:florian.schreiner2 at student.kit.edu] 
Sent: Wednesday, June 12, 2013 3:25 PM
To: trnsys-users at cae.wisc.edu
Subject: [TRNSYS-users] TRNSYS debug-mode and Visual Studio 2010

Dear TRNSYS Users,

I still have some convergence problems with my new type as already mentioned in a previous Email.
But I need to finish this type as soon as possible to be able to finish my diploma thesis. 

Therefore I would like to debug the created deck (including the new type) which causes the problems. 
Maybe I'm able to find and solve the problem hereby.
I'm using Visual Studio 2010 and up to now I compiled the type in the release-mode and tested it in TRNSYS.
But until know, I wasn't able to find the problems in this way. 
I guess to be able to debug the simulation I need to compile the type in the debug-mode. 
But how can I start debugging in TRNSYS or in other words, how can I use TRNSYS and  Visual Studio in the debug-mode? Is it necessary to compile all types of the simulation in debug-mode  to be able to debug or is it sufficient to compile only my type in the debug-mode?
Since I need this type urgently, I would by very happy if someone could help me.  
Thanks in advance!

Best regards,

TRNSYS-users mailing list
TRNSYS-users at cae.wisc.edu

More information about the TRNSYS-users mailing list