From: Paul on
Hi,

I have a S Function (level 2 in C) in Simulink. I want to use this S Function triggered by a clock - make the entire operations described in S Function only when a rising edge occurs. I build my S function, added it in a Simulink Subsystem, I added to this subsystem a Trigger connected to a clock.

Something is not running in the way I want, so I think something is wrong with the settings Sample Time. I'm using:
ssSetSampleTime(S, 0, INHERITED_SAMPLE_TIME);
ssSetOffsetTime(S, 0, FIXED_IN_MINOR_STEP_OFFSET);
is this correct?

--------------
Why am I doing this.
At the input of the S Function I have a signal sampled with this clock. I want to make an internal 1 sample delay of the signal. If I receive a sample every clock, than I'm using a Data Works for storing the previous sample.
The problem is that this Data Works loses some values. I think that maybe something is wrong with timing and there is another event which triggers my functions and writes a new value in my Data Works.
---------------

Thanks,
Paul