printf in mdlTerminate (mex S-function/simulink)

21 visualizaciones (últimos 30 días)
Anze Kunstelj
Anze Kunstelj el 9 de Mayo de 2016
Editada: Anze Kunstelj el 10 de Mayo de 2016
Hi,
I have a custom simulink block with some c++ code. Printf works fine in mldUpdate and mdlOutputs but its not working in mdlStart and mdlTerminate. Mex compiles successfully but there is nothing printed in the console. Is it even possible to use printf in those parts of the code?
Example:
static void mdlTerminate(SimStruct *S)
{
printf("Packets in queue:%i\n",queue_packets);
printf("bjkfdsaj");
fflush(stdout);
//cleanup
closesocket(sReceive);
closesocket(sSend);
WSACleanup();
}
EDIT: using R2014b

Respuestas (0)

Categorías

Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by