Hello,
Our team is quite new with the Motor Control Toolbox. More recently, we have been doing several tests to learn how to work with this new tool. We are using an MPC5643L and we are currently doing the tests with the development board.
We did a simple push button to LED model to test the digital inputs/outputs. We also did a simple logic with the dev board rotary potentiometer to control LEDs on the board.
We are now running into some problem taking an ADC input and sending it over CAN. In fact, when trying to generate code, one header file named DASH_TESTING_private.h is included in adc1_config.h but has not been created. This leads to an error since it cannot be found by Simulink. See picture attached.
Is this a common issue? Perhaps we are missing something when configuring the ADC or the CAN. I have also attached the simple model (R2017b) in case you want to run.
Thank you for your help.
Best,
Michael
Solved! Go to Solution.
Hi again mcgillformulaelectric,
The reason your model did not generate the <model_name>_private.h file is the selection of "File packaging format" to something other than "Modular". So for a quickfix, go to Code generation -> Code placement and set File packaging format to "Modular".
This option specifies whether code generation modularizes the code components into many files or compacts them into a few, in the following manner:
We will update our toolbox to take into consideration the file packaging format - in this regard I opened (internally) a bug and will post a hotfix on the community.
Hope this helps,
Razvan.
Hi again mcgillformulaelectric,
The reason your model did not generate the <model_name>_private.h file is the selection of "File packaging format" to something other than "Modular". So for a quickfix, go to Code generation -> Code placement and set File packaging format to "Modular".
This option specifies whether code generation modularizes the code components into many files or compacts them into a few, in the following manner:
We will update our toolbox to take into consideration the file packaging format - in this regard I opened (internally) a bug and will post a hotfix on the community.
Hope this helps,
Razvan.
Thank you for your quick support. We tried it and it works.
Thank you for your help.
Best,
Michael
McGill Formula Electric
<model_name>_private.h is a file that Simulink generates; it is a file that's used for some #includes, user data, etc. It seems the file was not generated - by default it should be, so there is an option enabled in Simulink so it does not generate that file. I will look into it and come back as soon as I have caught the option that is causing this. In the meanwhile, if you open an example from the Examples folder and have the same options selected from the "Code Generation" tab, the build will succeed.
I will write back shortly after finding out what option influences the generation of <model_name>_private.h .
Kind regards,
Razvan.