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

Re: [TRNSYS-users] Accessing parameters and outputs of other units



Marcello,
  In earlier versions of TRNSYS (prior to v17), the TRNSYS kernel passed a part of the global PAR() array to each component. Even if the component changed a parameter value in that array it didn't matter because the kernel never read them back. You are correct that Type70 accesses the entire global PAR() array directly and modifies it, which is quite dangerous if its not done right. There is a "setParameterValue(i,Value)" access function in Trnsys17 but the way it is written, it is designed only to be able to change the parameters of the current UNIT (not parameters of other units the way that Type70 does. You'll notice that in the most recent releases, Type70 doesn't use the official Trnsys17 coding standard for this very reason. I would recommend that you make a copy of Type70 and start working from it when you write your new component. BE CAREFUL THOUGH!!! It is going to be directly overwriting values stored in global arrays of the kernel!
best,
 David


On 9/27/2012 08:07, marcello.caciolo@cofelyaxima-gdfsuez.com wrote:

Dear TRNSYS users,

 

I would like to create a component similar to the type 70 (GROUPED PARAMETER REPLACEMENT UNIT) and I am trying to figure out how this component works.

 

Reading the code, I see that this type access other units parameters by accessing the npar, par and info arrays defined in trnsysData.f90.

 

I have two question:

 

1) In TRNSYS 17, are new access functions available in order to access parameters of other units without using these global arrays?

 

2) Is there a way for a unit called only after convergence (i.e. a plotter) to access in a similar way the outputs of other units?

 

Thank you for your help.

 

Best regards,

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

cid:image003.jpg@01CD4E08.954D04D0

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@cofelyaxima-gdfsuez.com

P Pensez à l'environnement avant d'imprimer ce message

 



_______________________________________________
TRNSYS-users mailing list
TRNSYS-users@cae.wisc.edu
https://mailman.cae.wisc.edu/listinfo/trnsys-users

-- 
***************************
David BRADLEY
Principal
Thermal Energy Systems Specialists, LLC
22 North Carroll Street - suite 370
Madison, WI  53703 USA

P:+1.608.274.2577
F:+1.608.278.1475
d.bradley@tess-inc.com

http://www.tess-inc.com
http://www.trnsys.com