MATLAB: Can I not access the data in Data Store blocks from an S-Function in Simulink 5.0 (R13)

datamemoryreads-functionsimulinkstorewrite

I cannot access the data in the Data Store blocks from an S-Function in Simulink 5.0 (R13).

Best Answer

The ability to read the data in the Data Store blocks from an S-Function is not available in Simulink 5.1 (R13). This feature has been added in Simulink 6.0 (R14) and later.
To read from the Data Store Write block in Simulink 6.0 and later, you can do something similar to the following in the S-Function:
rtObjDSW = get_param('mget_dsm/Data Store Write','RunTimeObject');
out = rtObjDSW.InputPort(1);
sys = out.data;
The above lines first obtain the interface for the Data Store Write block, and then extract the data from the input port. The S-Function can then output these values to the scope.