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.
Dear community,
I tried to link Matlab and TRNSYS via Type 155 but failed with the error below.
The simulation initially proceeds without problems, but then an error occurs at a certain moment.
(The moment of error occurrence is different depending on the simulation start time)
Has anyone else had the same problem as me or has any idea how to solve it?
------------------------------------------------------------
*** Warning at time : 1248.000000
Generated by Unit : 33
Generated by Type : 155
TRNSYS Message 315 : The TRNSYS processor has reported a potential problem with the connections in your input file. In version 16, there is a very specific calling order after convergence has been reached at each timestep. One of your connections flows against this calling order - for example you may have the output of an integrator connected as an input to a standard component (one that is being called iteratively at each timestep). While this is not technically an ERROR - it may cause incorrect values to be passed to the component. For example, the input to an iterating component from an integrator will be from the previously converged timestep and not the current timestep. Refer to the TRNSYS Manual - Volume 1 - for more information on the calling order for TRNSYS components
Reported information : ** Reported by Exec.f90
*** Fatal Error at time : 1259.000000
Generated by Unit : 33
Generated by Type : 155
Message : The M-File has flagged an error. Returned value for 'mFileErrorCode': 400.0000000000000 . The error occurred at info(7) = 0 , info(13) = 1
---------------------------------------------------------------
Thank you in advance,
@danalee The error would suggest that TRNSYS is sending a set of inputs to your *.m code that Matlab cannot solve. You might try adding a TRACE to your Type155 component. That will cause the input values that are being sent to Type155 to be written to your *.lst file. The data is a little hard to interpret (largely because there is a lot of it) but my hope is that you can isolate the set of inputs that is causing the error in Matlab then feed those into your Matlab code within the Matlab environment and see if you can find the problem.
kind regards,
David
@davidbradley Thank you very much for your comment. However, I am still a new user of TRNSYS so I did not fully understand your comment. If you could explain a little more about how to add TRACE, I would really appreciate it.
Best regards,
Dana
@danalee Dana, there are two ways that TRACE can be used.
The simple way is to select the component whose inputs outputs, and parameters you want to see then click the tool on the left hand side of the Simulation Studio whose icon looks like footprints. Run your simulation again and then go find the location of your Simulation Studio project file (*.tpf) in Windows Explorer. You should find a file with the same name but with the extension *.lst in the same location (this is the "list file" generated when your simulation runs). The results of the TRACE will be in the *.lst file. The *.lst file can be opened with a text editor like Notepad or Notepad++. The disadvantage of this method is that the component(s) you selected will be traced all throughout the simulation, which can generate an enormous amount of information in the *.lst file and make it hard to find what you're looking for.
The TRACE command can be modified to make it a bit more targeted. To do so, you'll have to run the simulation outside of the Simulation Studio. Start off the way you did in the steps above. However, once you have run the simulation, close down the project in Simulation Studio and open the program called TRNEdit (.\Trnsys18\Exe\TRNEdit.exe) and then browse to find the input file that Simulation Studio wrote. It will be located in the same place as your project file was but will have the extension *.dck. NOTE: you may have to change the TRNEdit "file type" field from "TRNSED Files" to "TRNSYS Files" in order for it to show you files with the extension *.dck. You should find a line in the input file that says TRACE START STOP
the keywords "START" and "STOP" tell TRACE when it should begin and end writing information. If you know that the problem occurs at some later point in the simulation (at hour 1573 for example) then you can change the line to be: TRACE 1570 STOP and the *.lst file will have a lot less extraneous data for you to sort through.
Once you modify the *.dck file you will have to run it from TRNEdit (select "Calculate" from the "TRNSYS" menu) rather than from the Simulation Studio. When you run it from the Simulation Studio the edits you have made to the *.dck will be overwritten.
kind regards,
David