MATLAB: How to obtain from Command Line the Data Store Memory Block name associated to a Data Store Read block in Simulink 7.5 (R2010a)

simulink

If I open the Data Store Read block mask I'm able to identify the associated Data Store Memory block. I can't find a specific block properties using GET_PARAM in MATLAB Command Window.

Best Answer

There's not a specific property associated to the Data Store Read Block that is reporting the corresponding Data Store Memory block. This is computed inside the block mask but not directly associated to a specific property.
You can consider this simple procedure in two steps to obtain the block name.
1) You can use the GET_PARAM command referring to the Data Store Read block to obtain the corresponding Data Store Name (the name of the Data Store, not of the corresponding block):
mem_name = get_param('datastore_example/Read','DataStoreName');
The first input is your Data Store Read block, the second is the specific option we are looking for.
2) You can use FIND_SYSTEM to identify in your model the Data Store Memory block with the corresponding Data Store Name (this must be just one block by its definition):
block_name = find_system('datastore_example','BlockType','DataStoreMemory','DataStoreName',mem_name)
The first input is your model name. Second and third inputs define the property BlockType to identify among all model blocks only Data Store Memory. Last two inputs analyzes all Data Store Memory to identify the one with the previously obtained Data Store Name.
This can be easily extended to identify corresponding Data Store Write blocks and vice-versa.