moha_sa Posted December 3, 2021 Share Posted December 3, 2021 Hi All, According to PMAC IDE page 394 (shown in the attachment too), when we use MATLAB to generate C code, in particular when we want to set up a tunable parameter as shown in the attachment, after clicking on *create files* button it is expected to see that “…_MATLAB_definitions.pmh” is being generated where ... is the name of a Simulink model, but this file is not created. I am using MATLAB R2021b and I see the following error appearing on MATLAB workspace as soon as I click that *create files* button. Error using Simulink.BlockDiagram.createVarStruct Too many output arguments. Error in CreateStructuredModel Error in PPMAC_param3 Error in gui_mainfcn (line 95) feval(varargin{:}); Error in PPMAC_param3 Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)PPMAC_param3('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback. Any idea how I can successfully generate “…_MATLAB_definitions.pmh” or what is wrong? Thanks._MATLAB_definitions.pmh is missing.pdf Quote Link to comment Share on other sites More sharing options...
Omron Forums Support Posted December 6, 2021 Share Posted December 6, 2021 The issue is the MATLAB version. Are you able to use 2020b or 2016a? Quote Link to comment Share on other sites More sharing options...
moha_sa Posted December 8, 2021 Author Share Posted December 8, 2021 The issue is the MATLAB version. Are you able to use 2020b or 2016a? Thanks Eric for your suggestion. Back to your comment we installed MATLAB 2020b on our windows 10. Still we are receiving the same error as before and do not see that the *..._MATLAB_definitions.pmh* file is being created. Please see attachments which shows the content of ppmactarget folder and our model files inside the *stepMDL__traj_ppmac* folder. Any idea how we can create *..._MATLAB_definitions.pmh* based on the manual? Thanks a lot.ppmacTarget folder.pdfno _MATLAB_definitions.pmh file is created.pdf Quote Link to comment Share on other sites More sharing options...
moha_sa Posted December 20, 2021 Author Share Posted December 20, 2021 The issue is the MATLAB version. Are you able to use 2020b or 2016a? I tried older MATLAB versions like 2020b and 2017b to generate [put simulink model name here]_MATLAB_definitions.pmh, but it did not work and still gives the same error as noted in the first message. We do not have license for older versions like 2016a. Any idea how we can solve this dependency file problem to take care of tunable gains in the matlab generated c-code? Thanks. Quote Link to comment Share on other sites More sharing options...
leandro.martins Posted January 31, 2022 Share Posted January 31, 2022 I already tried with 2019b and 2016a (which I guess it is the last compatible version on older IDE versions). It generated different files and I have the same problem of tunable gains. Apparently, Simulink substitutes the parameters with the gains defined in the workspace. I would suggest identifying the desirable tunable parameter in the C code and manually changing with "phsm->P[1]", for example. I never tried that, so it's just a guess 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.