Writing a Simulink.Signal directly from a S-Function
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Jarrod Rivituso
2011-4-8
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 个评论
Jiang Xin
2014-8-24
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!