Post Code Gen Script: What is "codertarg​et.postCod​eGenHookCo​mmand(h)"?

8 views (last 30 days)
This should be a simple enough question. In our Code Generation settings, the Advanced Parameter "Post code generation command" has a default value of "codertarget.postCodeGenHookCommand(h)".
And, most importantly,
  • Is there a script I can have run that gets the BuildInfo of a built model even if Simulink determines it is up to date so that I can execute a custom script at the end of a build even if every single item is completely up to date?

Answers (1)

Mark McBroom
Mark McBroom on 18 Nov 2023
The post code generation command is a MATLAB function with one argument "h", which is BuildInfo. By default for Simulink Coder and Embedded Coder, this option is empty. It looks like you are using a custom target that is performing some actions at the end of code generation. You should be able to edit this file and set break points in the file to better understand it.
  1 Comment
Dana Schwanke
Dana Schwanke on 21 Nov 2023
We originally had a custom target whose deployer had the AfterCodeGenFcn value set, but we have since removed this. Is that what "codertarget.postCodeGenHookCommand(h)" calls? I cannot find any online documentation for the built-in MATLAB object/package "codertarget", and all that typing "help codertarget" into MATLAB does is let me know that "codertarget" is a package and "postCodeGenHookCommand" is a function. It doesn't tell me what the expected parameter type is or what external code it is calling. Further, what is "h"? I'm not even sure what context the "h" is visible from, let alone its object type.

Sign in to comment.

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!