how to use custom c source code
how to use custom c source code
Hi Lubin,
The help for the c function call block says:
"The .c file containing the code of the function should be placed in the same directory as the .mdl file. If the c file is in another directory, it must be manually added in the "Simulation Parameters -> Real time workshop -> additional C file"
Can you please clear this up for me?
instead of "Simulation Parameters -> Real time workshop -> additional C file"
what would be the effect of putting the name of the c file in "Simulation Target > Custom Code > include custom c code in generated > source file?"
thanks,
John
The help for the c function call block says:
"The .c file containing the code of the function should be placed in the same directory as the .mdl file. If the c file is in another directory, it must be manually added in the "Simulation Parameters -> Real time workshop -> additional C file"
Can you please clear this up for me?
instead of "Simulation Parameters -> Real time workshop -> additional C file"
what would be the effect of putting the name of the c file in "Simulation Target > Custom Code > include custom c code in generated > source file?"
thanks,
John
-
- Site Admin - Expert
- Posts: 616
- Joined: Wed Mar 07, 2007 11:23 pm
- Location: Bayonne- France
- Contact:
Re: how to use custom c source code
Hi John,
I couldn't find "Simulation Parameters -> Real time workshop -> additional C file" on matlab 2011b.
The help file seems not up to date (or I write something wrong, anyway, I think this comes from an older matlab version...)
The correct place to add the file is the one you provided. Please do not hesitates to update directly the wiki help page when you noticed this kind of remarks.
Lubin
I couldn't find "Simulation Parameters -> Real time workshop -> additional C file" on matlab 2011b.
The help file seems not up to date (or I write something wrong, anyway, I think this comes from an older matlab version...)
The correct place to add the file is the one you provided. Please do not hesitates to update directly the wiki help page when you noticed this kind of remarks.
Lubin
Re: how to use custom c source code
Hi Lubin,
The attached screen image shows the configuration parameters and where I enter the names of the custom c files. Instead of "Simulation Target" they might also go under "Code Generation." Please verify--do I have it right? Does it work just as well to put the file names under"Code Generation?" Regards, John
The attached screen image shows the configuration parameters and where I enter the names of the custom c files. Instead of "Simulation Target" they might also go under "Code Generation." Please verify--do I have it right? Does it work just as well to put the file names under"Code Generation?" Regards, John
- Attachments
-
- configScreen.jpg (56.88 KiB) Viewed 52224 times
-
- Site Admin - Expert
- Posts: 616
- Joined: Wed Mar 07, 2007 11:23 pm
- Location: Bayonne- France
- Contact:
Re: how to use custom c source code
Hi John,
That's not correct.
File reference must be included into "Include list of additional". Otherwise, simulink will just add the name on the file within the generated code, that would create an error!
Then, the files should be included into the Code Generation panel. Not the Simulation Target (did not notice this earlier)
Lubin
That's not correct.
File reference must be included into "Include list of additional". Otherwise, simulink will just add the name on the file within the generated code, that would create an error!
Then, the files should be included into the Code Generation panel. Not the Simulation Target (did not notice this earlier)
Lubin
Re: how to use custom c source code
Like this?
- Attachments
-
- configScreen2.jpg (53.68 KiB) Viewed 52223 times
-
- Site Admin - Expert
- Posts: 616
- Joined: Wed Mar 07, 2007 11:23 pm
- Location: Bayonne- France
- Contact:
Re: how to use custom c source code
Correct.
you might also add the folder where they are in the "include directory" box if the compiler did not find theses files.
Lubin
you might also add the folder where they are in the "include directory" box if the compiler did not find theses files.
Lubin
Re: how to use custom c source code
Lubin,
I imagine this does not work with the demo version does it.
I imagine this does not work with the demo version does it.
-
- Site Admin - Expert
- Posts: 616
- Joined: Wed Mar 07, 2007 11:23 pm
- Location: Bayonne- France
- Contact:
Re: how to use custom c source code
It works with the demo version or at least it should work 

Re: how to use custom c source code
Lubin,
John
Like this? I ask because this produces an error (see my other post about GenericTypeDefs.h)LubinKerhuel wrote:Correct.
you might also add the folder where they are in the "include directory" box if the compiler did not find theses files.
Lubin
John
-
- Site Admin - Expert
- Posts: 616
- Joined: Wed Mar 07, 2007 11:23 pm
- Location: Bayonne- France
- Contact:
Who is online
Users browsing this forum: No registered users and 37 guests