How does the implementation of sample time for system objects work?

1 visualización (últimos 30 días)
Fabian Hartmann
Fabian Hartmann el 22 de Mayo de 2019
Respondida: Archit Dhanani el 19 de Jul. de 2019
I want to create a system object with 'Controllable Sampling Time'. Unfortunately, the way the implementation of saple times works for system objects is arcane to me, as I don't understand, why the documentation just uses routines like 'createSampleTime' and 'getSampleTimeImpl'.
Thus I would like to now, how to implement 'controlable sampling time' in a minimal example and how Matlab uses the parts of such an example, especially, where the sample time is called, so I might understand why it works the way it does.

Respuestas (1)

Archit Dhanani
Archit Dhanani el 19 de Jul. de 2019
Hi Fabian,
I am not sure if there are specific example demostrating this in System objects.
There are SFunction examples which you could look at. The model sfcndemo_pwm uses controllable sample time. You can explore the c-code used for this S-function. You can find this example at:
<matlabroot>/toolbox\simulink\simdemos\simfeatures\sfcndemo_pwm.slx
-Archit

Categorías

Más información sobre Block and Blockset Authoring en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by