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 or Post 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

[Solved] TYPESTUDIO-An error was reported during the generation of the DLL file

4 Posts
2 Users
2 Reactions
539 Views
1
Topic starter

I would like to ask some questions about TypeStudio. I'm writing a new component using TypeStudio, but a problem arose during the final generation of the DLL file, an error message: undefined reference to 'updatereportvalue' . The screenshot is attached.

A_Weiss A_Weiss 05/05/2023 2:28 pm

@meiling_j Can you include the source code from your Type as part of your post? (Edit the post -> Click on the  "<>"symbol in the tool bar -> copy and paste code from your Type). I can't tell from the screenshot alone where the 'updatereportvalue' error might be coming from, but if I could see the full code I might be able to take a guess.

2 Answers
1

Ah, that helps!

'updateReportValue' is not a valid Simulation Summary Report (SSR) command. Only 'updateReportMinMax' and 'updateReportIntegral' may be used to update entries at the end of a timestep. 

'Values' in the SSR are intended for critical parameters for a Type, such as capacity, rated power, rated efficiency, etc. They are initialized at the beginning of the simulation, and they can't be updated as the simulation progresses. They are included in the report to identify or re-iterate which equipment is being reported for that entry (i.e. these results are for the 20 kW heater, those results are for the 5 kW pump).  

You could change the 'updateReportValue' calls to 'updateReportIntegral' to get integrated values for Reaction_rate and Degree_of_reaction over the simulation, or use 'updateReportMinMax' to get minimum and maximum values for these variables over the simulation. 

You can read more hints, tips, and examples for SSR coding and reporting in Section 7.3.17 of the Programmers' Guide, found in the Documentation folder of your main TRNSYS18 directory. 

meiling_J Topic starter 06/05/2023 5:41 am

@a_weiss Thank you very much for answering me, it was very helpful to me!

0
Topic starter

This is part of the code for my new type, and that's where I think the problem arises.

!Set the Version Number for This Type
      If(getIsVersionSigningTime()) Then
		Call SetTypeVersion(17)
		Return
      EndIf
!-----------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------
!Do Any Last Call Manipulations Here
      If(getIsLastCallofSimulation()) Then
		Return
      EndIf
!-----------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------
!Perform Any "After Convergence" Manipulations That May Be Required at the End of Each Timestep
      If(getIsEndOfTimestep()) Then
     
     ! Set up this Type's entry in the SSR
      If (getIsIncludedInSSR()) Then
       
       Call updateReportValue(1,getOutputValue(1)) !Degree_of_reaction
       Call updateReportValue(2,getOutputValue(2)) !Reaction_rate
       Call updateReportMinMax(1,getOutputValue(3)) ! Reaction temperature
       Call updateReportMinMax(2,getOutputValue(4)) !Heat transfer fluid outlet temperature
      
      EndIf
		
		Return
      EndIf
!-----------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------
!Do All of the "Very First Call of the Simulation Manipulations" Here
      If(getIsFirstCallofSimulation()) Then

		!Tell the TRNSYS Engine How This Type Works
		Call SetNumberofParameters(19)           !The number of parameters that the the model wants
		Call SetNumberofInputs(6)                   !The number of inputs that the the model wants
		Call SetNumberofDerivatives(0)         !The number of derivatives that the the model wants
		Call SetNumberofOutputs(4)                 !The number of outputs that the the model produces
		Call SetIterationMode(1)                             !An indicator for the iteration mode (default=1).  Refer to section 8.4.3.5 of the documentation for more details.
		Call SetNumberStoredVariables(0,2)                   !The number of static variables that the model wants stored in the global storage array and the number of dynamic variables that the model wants stored in the global storage array
		Call SetNumberofDiscreteControls(0)               !The number of discrete control functions set by this model (a value greater than zero requires the user to use Solver 1: Powell's method)
        ! Set the Correct Input and Output Variable Types
        Call setInputUnits(1,'TE3') 
        Call setInputUnits(2,'TE3') 
        Call setInputUnits(3,'MF2') 
        Call setInputUnits(4,'PR3') 
        Call setInputUnits(5,'CF1') 
        Call setInputUnits(6,'DN1')
        Call setOutputUnits(1,'DG1')  
        Call setOutputUnits(3,'TE3') 
        Call setOutputUnits(4,'TE3')
        
        ! Set up this Type's entry in the SSR
      If (getIsIncludedInSSR()) Then
         Call setNumberOfReportVariables(0,4,6,0) !(nInt,nMinMax,nVals,nText)
      EndIf
        
        
        
		Return

      EndIf
Share: