Why does the Simulink Accelerator 6.0 (R14) produce incorrect results when using a C MEX S-function with variable step timing in a Simulink model?
Show older comments
I am using the following callback in my S-function
mdlGetTimeOfNextVarHit
and I have set the Sample Time of my S-function as follows
static void mdlInitializeSampleTimes(SimStruct *S)
{
if(ssGetSimMode(S) == SS_SIMMODE_RTWGEN)
{
ssSetSampleTime(S, 0, INHERITED_SAMPLE_TIME);
ssSetOffsetTime(S, 0, 0.0);
}
else
{
ssSetSampleTime(S, 0, VARIABLE_SAMPLE_TIME);
ssSetOffsetTime(S, 0, 0.0);
}
}
The output of my S-function is always zero when I use the Simulink Accelerator.
Accepted Answer
More Answers (0)
Categories
Find more on Simulink Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!