[TRNSYS-users] TRNSYS18 Own Component Message 105

John Dyreby john at nnumerics.com
Tue Jan 15 07:29:42 PST 2019


Daniel,

The "undefined reference" errors are due to the plotter-specific variables exposed by the TrnsysData module that are not included in the "known" TRNSYS variables that are handled behind the scenes in Type Studio's compiler.  Type Studio started as a mathematical / component-level Type creator, which never considered the need to compile custom online plotter Types.  It may be possible to add that functionality to Type Studio in the future, but I'm not sure it's necessary.

To accomplish what you're trying to do, I would suggest creating an Equation (for a simple integrated unit conversation) or a custom Type (for more complex situations) that outputs the values you expect to plot.  In other words, use Type 65d as-is with the custom output you want plotted calculated outside of it.

Best regards,
John

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, January 15, 2019 8:49 AM, Hofmann, Daniel <daniel.hofmann at dreso.com> wrote:

> Hello John,
>
> thank you for your prompt reply. I tried your suggestion with only the Type201.f90 file loaded. But compiling interrupts with the following error:
>
> C:\Users\HofmannD\AppData\Local\Temp\cc482Y2Q.o:Type201.f90:(.rdata$.refptr.__trnsysdata_MOD_ontitl[.refptr.__trnsysdata_MOD_ontitl]+0x0): undefined reference to `__trnsysdata_MOD_ontitl'
>
> C:\Users\HofmannD\AppData\Local\Temp\cc482Y2Q.o:Type201.f90:(.rdata$.refptr.__trnsysdata_MOD_onlab[.refptr.__trnsysdata_MOD_onlab]+0x0): undefined reference to `__trnsysdata_MOD_onlab'
>
> C:\Users\HofmannD\AppData\Local\Temp\cc482Y2Q.o:Type201.f90:(.rdata$.refptr.__trnsysdata_MOD_plout[.refptr.__trnsysdata_MOD_plout]+0x0): undefined reference to `__trnsysdata_MOD_plout'
>
> C:\Users\HofmannD\AppData\Local\Temp\cc482Y2Q.o:Type201.f90:(.rdata$.refptr.__trnsysdata_MOD_prout[.refptr.__trnsysdata_MOD_prout]+0x0): undefined reference to `__trnsysdata_MOD_prout'
>
> Thats probably because the compiler searches the functions declared in the “Use-statements” at the beginning of my source code:
>
> Subroutine Type201
>
> !export this subroutine for its use in external DLLs.
>
> !DEC$ATTRIBUTES DLLEXPORT :: TYPE201
>
> !-----------------------------------------------------------------------------------------------------------------------
>
> Use TrnsysConstants
>
> Use TrnsysFunctions
>
> Use TrnsysData, Only:onlab,prout,plout,ontitl
>
> !-----------------------------------------------------------------------------------------------------------------------
>
> Here the code continues…..
>
> Deleting the part “Only:onlab,prout,plout,ontitl” doesn’t help, too.
>
> Best regards
>
> Daniel Hofmann
>
> From: TRNSYS-users <trnsys-users-bounces at lists.onebuilding.org> On Behalf Of John Dyreby via TRNSYS-users
> Sent: Tuesday, January 15, 2019 2:20 PM
> To: Hofmann, Daniel via TRNSYS-users <trnsys-users at lists.onebuilding.org>
> Cc: John Dyreby <john at nnumerics.com>
> Subject: Re: [TRNSYS-users] TRNSYS18 Own Component Message 105
>
> Hello,
>
> I’m not sure exactly what the problem is, but it’s not necessary or advised to open all the extra source files (TrnsysFunctions.f90, TrnsysData.f90, etc...) into Type Studio. That could be causing the problem.
>
> Please try again with only your Type201.f90 file loaded into a new Type Studio workspace and see if that fixes the problem.  After a successful compilation you should see in the UserLib directory the newly created single Type201.dll file that TRNSYS will load externally.
>
> If that doesn’t fix the problem, feel free to send me your custom Type source code (assuming it isn’t proprietary) and I can try to compile and load it on my computer to help sort out what is going wrong.
>
> Regards,
>
> John
>
> john at nnumerics.com
>
> On Tue, Jan 15, 2019 at 6:17 AM, Hofmann, Daniel via TRNSYS-users <trnsys-users at lists.onebuilding.org> wrote:
>
>> Dear TRNSYS-Users,
>>
>> I rewrote the Type 65d Source Code to include an integrated custom unit conversion. I called this new Type “Type201”.
>>
>> I used the Type Studio to compile the Type. In Type Studio I loaded the source files SSRData.f90, TrnsysFunction.f90, TrnsysData.f90, TrnsysConstants.f90 and of course the Type201.f90. Compiling went successful and the expected dll.-files in  the “UserLib” folders were created. I put the Type201 source code in the “MyTypes”-folder and created a suitable proforma in …TRNSYS18StudioProformas.
>>
>> However when creating a new TRNSYS Project in Simulation Studio and testing the new component I get an Error message 105: “A TYPE was called in the TRNSYS input file but was either not linked into trndll.dll or was not found in an external dll. A dummy subroutine was called in its place. Please link the TYPE or remove it from the input file  Reported information  :  Type201 could not be located in either the TRNdll64.dll or in an external dll. Please relink theTRNDll64.dll including this Type or make sure that an external DLL in the UserLibDebugDLLs and UserLibReleaseDLLs folders contain the Type.”
>>
>> I really don’t know what causes this problem.  I thought that I don’t need to recompile the TRNDLL when I put the external dlls into the UserLib-folder. Has anyone an idea of how to solve the problem?
>>
>> Best regards
>>
>> Daniel Hofmann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20190115/b92874a7/attachment.htm>


More information about the TRNSYS-users mailing list