0

I'm tying to get a list of the compiled port data-types from within a function being called by PostCodeGenCommand during rtw build. get_param(outportlist,'CompiledPortDataTypes')is returning empty cell arrays as though the model were not compiled. If I put the command Model([],[],[],'compile'); into the script I get an error about a recursive function call.

Is there a handle to the compiled model that I should be passing to my PostCodeGenCommand?

1 Answers1

0

instead of

Model([],[],[], 'compile')

using the following code works for me:

get_param('f14', 'SimulationStatus')
set_param('f14', 'SimulationCommand', 'start')
set_param('f14', 'SimulationCommand', 'pause')
portdata = get(gcbh, 'CompiledPortDataTypes')
set_param('f14', 'SimulationCommand', 'stop')

as you can see, I tested this on the f14 demo model. It's more a hack, but if there are no complex initialization procedures for the model, this works fine.