Equivalent of ssGetSimMode for Matlab S-Function

5 visualizaciones (últimos 30 días)
Florent
Florent el 29 de Dic. de 2013
Respondida: Florent el 29 de Dic. de 2013
Hi,
The function ssGetSimMode specifies if the current simulation is about code generation, external simulation... This function is for C/C++ S-Function, does an equivalent for Matlab S-Function exist?
TIA,
- Florent

Respuestas (1)

Florent
Florent el 29 de Dic. de 2013
After a look at matlabroot\R2013a\toolbox\rtw\rtw\tlc_c.m around line 176, the parameter 'RTWCGKeepContext' seems to hold during RTW builds and not to hold during normal simulations.
function Start(block)
if strcmp(get_param(gcs,'RTWCGKeepContext'),'on')
disp('### Detecting a RTW build');
% do not start the simulation locally
% why is this function called when the RTW model is being built?
return;
else
disp('### Detecting a normal simulation');
end
...
end
However, there should be a cleaner way to detect this, as in C S-Function.

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by