Matlab SImulink dSPACE compile error Failed to read target file "grt.tlc".

45 views (last 30 days)
I have been trying to set up my DS1104 using this tutorial https://www.youtube.com/watch?v=KDvoGsbAXXk
However, when trying to compile my script I get this error:
>> Test
Error using rti_builddir
RTI_BUILDDIR: Failed to read target file "grt.tlc".
Error in rti_build2
Error in Test (line 1)
rti_build2('testfile')
I have tried to place the files in different places in case it was a path issue. When in documents I get the error above, but when placed on the desktop I get no error, but just a ans = 1 instead of the code actually compiling.
Any thoughts?

Answers (1)

Arjun Sadahalli
Arjun Sadahalli on 6 Sep 2017
Edited: Arjun Sadahalli on 6 Sep 2017
Hi Shane,
It appears from the error message that your model is not configured properly to work with dSPACE 1104. The Configuration Parameters of the model need to be modified to compile and build the model successfully. Specifically, the 'Solver' need to be changed and the correct Target Language Compiler (TLC) needs to be set.
Before proceeding to the next step, please ensure that dSPACE Control Desk software and all the required TLC's are installed in the system.
Please follow the steps below to modify the Configuration Parameters:
1) Open the Model. The 'Model Configuration Parameters' dialog can be accessed by either clicking on the 'Gear' icon on the ribbon or by using the keyboard shortcut 'Ctrl + E'.
2) Select 'Solver' from the list. Please modify:
Stop time: Inf
Solver Options -> Type - Fixed Step
Expand the Additional options menu
Fixed-step size (fundamental sample time): 0.01 (or based on the requirement)
Creating a new Simulink model by default will set the Stop time to '10', Solver Type to 'Variable-step' which is not compatible for code generation.
3) Select 'Code Generation' from the list.
Target selection -> System target file -> Browse -> Select 'rti1104.tlc'.
As you are using dSPACE 1104, you need to use 'rti1104.tlc' in your model to compile and build. Simulink by default uses the 'grt.tlc' as the TLC when you create a new model.
I also looked at the YouTube video. You might be wondering that the author of the video did not do these steps explicitly. The answer is that at time-stamp 0:20/9:07 in the video, you can see that a dSPACE dialog box opens up asking the user to select the dSPACE RTI Platform. Selecting RTI1104 I believe automatically sets the build platform. Moreover, at 3:35/9:07, it can be observed from the last line of the verbose output in the MATLAB Command Window that the model is using 'rti1104.tlc'.
Anyway, good luck with the rest of the set-up.
Regards,
Arjun Sadahalli

Categories

Find more on Simulink Coder in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!