Writing a Simulink.Signal directly from a S-Function
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Is it possible to write a Simulink.Signal directly from a C MEX S-Function smilar to a Data-Store-Write-Block? If yes, whats the command to do this? The S-Function should not have any output ports to the Simulink model.
0 comentarios
Respuestas (2)
Jarrod Rivituso
el 8 de Abr. de 2011
Are you asking whether you can write values to a data store memory element from within an S-function? If so, I personally do not know how, but my workaround would be to have an S-function output that went directly to a data store write block. You could wrap the S-function and Data Store Write block in a subsystem so the block appeared not to have an output port.
If you are asking about creating a Simulink.Signal object from within an S-function, then I do not think that can be done. Furthermore, I'm not sure why you would do that. Simulink.Signal objects define signal properties in an object that is separate from the model. They do not represent the actual signal value over time. They generally are defined prior to the model simulation, and do not change during the simulation run-time (which is when the S-function would execute).
1 comentario
Kaustubha Govind
el 8 de Abr. de 2011
+1 for connecting S-function output to a Data Store Write block.
Jiang Xin
el 24 de Ag. de 2014
The S-Function macros in simstruc.h actually provides way to do so, e.g., using ssWriteToDataStore, but I'm not sure how to use them properly, may be some internal documents from Mathworks is needed
0 comentarios
Ver también
Categorías
Más información sobre Simulink Functions 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!