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) 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

Message105 appears in the test after developing new components

3 Posts
2 Users
0 Likes
242 Views
0
Topic starter

Hi Community,

I used C + + to develop a new heat exchanger component 201, which can run the code normally, but when the component runs in TRNSYS, the following errors will occur :

TRNSYS 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 trndll.dll or in an external dll. Please relink theTRNDll.dll including this Type or make sure that an external DLL in the \UserLib\DebugDLLs and \UserLib\ReleaseDLLs folders contain the Type.

It is added that when these functions for storing data, such as SetStorageSize(), are not added at the beginning, they can operate normally, but because the component needs to call the data at the previous moment due to the time change, the function is added.

I don't know if the function is the issue or the way i added the function. If you have any advice in case you had same case, please don't ignore my request. Thank you very much.

Kind regards.

1 Answer
0

There are two potential issues here: the DLL containing the Type201 component is not in the correct place or that the Type201 code does not correctly export the component.

You can check the first issue by looking at the *.lst file from the simulation. It will contain a list of the DLLs that it found and checked for exported components. If you file it not included in the list then your DLL is not in the appropriate folder.

If the *.lst file shows that the DLL is read but the component is not found, then it is likely that the component is not exported properly from the DLL.  The C++ code for the component must include the following line:

extern "C" __declspec(dllexport) void TYPE201(void){}

Yujie Su Topic starter 06/09/2023 9:52 am

@timmcdowell Thank you very much for your reply.
I check the *.lst file that shows the Dll is read, so regard to your advice, the issue might be the 201 component is not exported properly from the DLL.
But My C++ code include the following line:
extern "C" __declspec(dllexport) int TYPE201(double &time, double xin[]...){}
This infrastructure was derived from TRNSYS17, "File"-"Export as"-"C + +" in turn. I would like to ask if it must be void type, or can provide some reference files about C + + create DLL files? Thank you, sir.

TimMcDowell 06/09/2023 2:16 pm

The ProgrammersGuide volume of the TRNSYS Documentation set has specific instructions for writing a component in C++.

My advice is to start the component very simply - like just adding two inputs to make an output - and make sure that works before adding further complexity to your code.

Share: