I have attached an excerpt (stripped down to the point that it's nonsensical, I realize) from my Simulink model and App Designer app. It appears to run successfully now that I've put the definition "hApp = CAN_UI;" at the beginning of the StartFcn callback (until I stop the GUI at which point it throws up warnings about missing or deleted object and starts beeping).
The instructions in the info from MathWorks at "https://www.mathworks.com/matlabcentral/answers/446302-how-do-i-update-a-gui-designed-in-app-designe...." say to put that definition into the InitFcn callback, but when I did so, the definition disappears when model simulation is run, and if I've deleted "mbd_s32k_consistency_checks(bdroot(gcs));", that reappears. It seems to me that the NXP S32K Configuration process is over-writing the contents of the InitFcn callback with its call to its consistency checks function rather than playing nice with others and appending to the contents.
How do I put a definition into the InitFcn callback and have it stay there, even with the NXP Configuration block in the model?
Thanks for whatever help you can offer.
NOTE: To exercise the attached system, run the model with the block "OnOffAnglesInput" open. The model will start the GUI. In the GUI, check the box on the left of the screen, labeled Cyl 1. Then press the On button. The numbers in the two boxes to the right are pulled from updated values in the model -- elements 3 and 4 from the 30-element vector shown in Display6 in the model. If you put in a pair of numbers in the blocks next to the check box and click ON, the numbers are updated in the model (in the block "ForEachAngleModulo720": 120 is added to the numbers entered, their new value modulo 720 is calculated, and the new values written to places 3 and 4 in Display6). The updated values go back to the GUI for display in the right-hand two boxes. If you want to enjoy the beeping phenomenon, close the app while the model is still running and wait 1 to 2 minutes. I don't understand the time lag in the beeping -- it also continues for a while even after the model is stopped.
Regards,
Nancy