[TRNSYS-users] new component linking problem

David BRADLEY d.bradley at tess-inc.com
Tue Oct 12 07:37:58 PDT 2010


Dimas,
   There are two parts to generating a template for a new component.

   First, you create a new *.tmf (trnsys model file) in the Studio. You 
enter a Type number and you define the inputs, outputs, and parameters. 
Then you save the new component (at which point a new icon will appear 
in the Simulation Studio direct access tree and the *.tmf and *.bmp 
files will be saved to the ..\Trnsys17\Studio\Proformas\ directory. This 
process only creates the proforma.

   Second, open your proforma and select "Export As... Fortran" from the 
File menu. At this point either a *.for file (if you are using Trnsys16) 
or a *.f90 file (if you are using Trnsys170 will be generated and the 
Studio will attempt to open your Fortran compiler. If it does not 
succeed, open your compiler manually, create or import a workspace 
project that is appropriate to your compiler (a *.dsw workspace if you 
are using the Compaq compiler or a *.sln file if you are using the Intel 
compiler). Edit the Fortran code to add your equations, compile, then link.

Best,
  david


On 10/12/2010 01:14, Dimas Firmanda Al Riza wrote:
> God day to you!
>
> I try to make a new component,
> after I exported to .for and make new folder (Mycomponent)
> why the folder does not appear in windows explorer, it is appear only 
> in Simulation Studio tree?
> I try to search .for file in the windows explorer, but even the folder 
> My component can't be found in TRNSYS directory
> Do you know about this?
>
> Thank you so much
>
> On Tue, Oct 12, 2010 at 1:17 AM, David BRADLEY <d.bradley at tess-inc.com 
> <mailto:d.bradley at tess-inc.com>> wrote:
>
>     Marion,
>      Check to make sure that the version of trnsys.h that you are
>     using has the TYPECK, getSimulationTimeStep, and
>     getSimulationStartTime functions exported properly for C++. I'm
>     not familiar with the "send client message" routine; make sure
>     that you have added whatever library that is part of to your Type
>     as well.
>     Regards,
>      David
>
>
>
>     On 10/8/2010 16:03, Kerl, Marion (SCR US EXT) wrote:
>>
>>     Hey everyone,
>>
>>     I want to create my own new component. I followed the manual and
>>     create a new component  in the TRNSYS Studio. Following that, I
>>     exported the components via the "Export to C++".
>>
>>     Then I created a project in Visual Studio and added the exported
>>     cpp-file and the TRNSYS.h to my project.
>>
>>     When I want to make a build of my project, I get these error
>>     messages:
>>
>>                 1>Link:
>>
>>                 1>     Creating library
>>                 C:\TRNSYS16_1\Studio\Proformas\My
>>                 components\compTYP201\Debug\compTYP201.lib and object
>>                 C:\TRNSYS16_1\Studio\Proformas\My
>>                 components\compTYP201\Debug\compTYP201.exp
>>
>>                 1>Type201.obj : error LNK2019: unresolved external
>>                 symbol "int __cdecl sendclientmessage(int const *,int
>>                 const *)" (?sendclientmessage@@YAHPBH0 at Z) referenced
>>                 in function "int __cdecl sendclienterror(int const
>>                 *,int const *)" (?sendclienterror@@YAHPBH0 at Z)
>>
>>                 1>Type201.obj : error LNK2019: unresolved external
>>                 symbol
>>                 __imp__TRNSYSFUNCTIONS_mp_GETSIMULATIONTIMESTEP
>>                 referenced in function _TYPE201
>>
>>                 1>Type201.obj : error LNK2019: unresolved external
>>                 symbol
>>                 __imp__TRNSYSFUNCTIONS_mp_GETSIMULATIONSTARTTIME
>>                 referenced in function _TYPE201
>>
>>                 1>Type201.obj : error LNK2019: unresolved external
>>                 symbol __imp__TYPECK referenced in function _TYPE201
>>
>>                 1>C:\TRNSYS16_1\Studio\Proformas\My
>>                 components\compTYP201\Debug\compTYP201.dll : fatal
>>                 error LNK1120: 4 unresolved externals
>>
>>                 1>
>>
>>                 1>Build FAILED.
>>
>>                 1>
>>
>>     What's wrong? Are there any files in my project missing?
>>
>>     Thank you in advance.
>>
>>     Regards,
>>
>>     Marion
>>
>>
>>     _______________________________________________
>>     TRNSYS-users mailing list
>>     TRNSYS-users at cae.wisc.edu  <mailto:TRNSYS-users at cae.wisc.edu>
>>     https://www-old.cae.wisc.edu/mailman/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 at tess-inc.com  <mailto:d.bradley at tess-inc.com>
>
>     http://www.tess-inc.com
>     http://www.trnsys.com
>
>
>     _______________________________________________
>     TRNSYS-users mailing list
>     TRNSYS-users at cae.wisc.edu <mailto:TRNSYS-users at cae.wisc.edu>
>     https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users
>
>
>
> _______________________________________________
> TRNSYS-users mailing list
> TRNSYS-users at cae.wisc.edu
> https://www-old.cae.wisc.edu/mailman/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 at tess-inc.com

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20101012/1ae1cf08/attachment-0001.htm>


More information about the TRNSYS-users mailing list