필터 지우기
필터 지우기

Writing a Simulink.Signal directly from a S-Function

조회 수: 2 (최근 30일)
Ralf
Ralf 2011년 4월 8일
답변: Jiang Xin 2014년 8월 24일
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.

답변 (2개)

Jarrod Rivituso
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
Kaustubha Govind
Kaustubha Govind 2011년 4월 8일
+1 for connecting S-function output to a Data Store Write block.

댓글을 달려면 로그인하십시오.


Jiang Xin
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

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by