I read an introduction about DSPACE as I attached below. I did not really understand about that. I understand that before click "Build Model" icon in Simulink, I need to add all C code file (<grampc_root>/matlab/include) into Source file, right?</grampc_root>
With regard to your first question. You have to change the file probfct.c, which contains the dynamics, cost functions, constraints and the corresponding derivatives. Please refer to section 3 of the manual.
Regards,
Felix
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are almost right about your second question. However, the files must be specified as additional build information, as it is stated in the documentation. I.e. in the fields below your red rectangle.
Regards,
Tobias
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So, as you stated above, I captured the picture of custom code. So can you take an example for the red and blue rectangule? I mean you put the files that needed to put in each rectangule
Best regards
Mai Van Ngoc
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So, as you stated above, I captured the picture of custom code. So can you take an example for the red and blue rectangule? I mean you put the files that needed to put in each rectangule
Hey,
in the red rectangle you don't need to add anything. To the additional build information (the blue rectangle) you have to add <grampc_root>/matlab/include and <grampc_root>/include in the field "Include directories". In the field "Source files" (in the blue rectangle) you have to add all files in the folder <grampc_root>/src, similiar to how you added them in the red rectangle. Beside this, your problem description file (e.g. probfct.c) and the file <grampc_root>/matlab/src/grampc_run_Sfct.c must be added.</grampc_root></grampc_root></grampc_root></grampc_root>
Best regards,
Tobias
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As you suggested, I added <grampc_root>/matlab/include and <grampc_root>/include in the field "Include directories". And in the "Source files" (in the blue rectangle) I also added all files in the folder <grampc_root>/src. In addition, I also added probfct_PMSM.c and the file <grampc_root>/matlab/src/grampc_run_Sfct.c for examle of PMSM in the source file. Finally, I selected "DSpace DS1401 Hardware Platform" for code generation compatible with DSPACE system. Did I set right?</grampc_root></grampc_root></grampc_root></grampc_root>
Dear Sir,
I read an introduction about DSPACE as I attached below. I did not really understand about that. I understand that before click "Build Model" icon in Simulink, I need to add all C code file (<grampc_root>/matlab/include) into Source file, right?</grampc_root>
Thank you very much
Last edit: MAI VAN NGOC 2019-08-16
With regard to your first question. You have to change the file probfct.c, which contains the dynamics, cost functions, constraints and the corresponding derivatives. Please refer to section 3 of the manual.
Regards,
Felix
You are almost right about your second question. However, the files must be specified as additional build information, as it is stated in the documentation. I.e. in the fields below your red rectangle.
Regards,
Tobias
So, as you stated above, I captured the picture of custom code. So can you take an example for the red and blue rectangule? I mean you put the files that needed to put in each rectangule
Best regards
Mai Van Ngoc
So, as you stated above, I captured the picture of custom code. So can you take an example for the red and blue rectangule? I mean you put the files that needed to put in each rectangule
Best regards
Mai Van Ngoc
Last edit: MAI VAN NGOC 2019-08-16
Hey,
in the red rectangle you don't need to add anything. To the additional build information (the blue rectangle) you have to add <grampc_root>/matlab/include and <grampc_root>/include in the field "Include directories". In the field "Source files" (in the blue rectangle) you have to add all files in the folder <grampc_root>/src, similiar to how you added them in the red rectangle. Beside this, your problem description file (e.g. probfct.c) and the file <grampc_root>/matlab/src/grampc_run_Sfct.c must be added.</grampc_root></grampc_root></grampc_root></grampc_root>
Best regards,
Tobias
As you suggested, I added <grampc_root>/matlab/include and <grampc_root>/include in the field "Include directories". And in the "Source files" (in the blue rectangle) I also added all files in the folder <grampc_root>/src. In addition, I also added probfct_PMSM.c and the file <grampc_root>/matlab/src/grampc_run_Sfct.c for examle of PMSM in the source file. Finally, I selected "DSpace DS1401 Hardware Platform" for code generation compatible with DSPACE system. Did I set right?</grampc_root></grampc_root></grampc_root></grampc_root>
Thank you very much