what is the difference between data store memory and goto-from blocks ?

in this example given in the page-> Model Global Data by Creating Data Stores
Data store memory (read/write) is used for getting the Error to switch between two values.
Instead, why can't the goto- from blocks be used ?

 Réponse acceptée

Hi Noufal,
the main difference is, that data store memory and read/write remove the dependency between reading and writing, i.e., the data flow: you can read and write anywhere in the model at any time.
In contrast the from-goto blocks are like having a connection between the goto and the from (it's only a different representation, instead of drawing a line you use the from/goto). But the data dependency stays intact.
Titus

5 commentaires

thanks Titus,
does this mean that DSM can write a data at any instance and it can be read at any instance later.
How does DSM affect the autocode?
yes, that's right. From a code generation perspective it's like a global variable (or of limited scope, depending how you configure), where anywhere in the code a read or write can happen. As said, it's very versatile but you loose the data flow of Simulink.
Using a DSM sounds like it would give problems if it is an input into an algebraic loop.
That's a good remark: depending on how connected, execution order might be changed to have no algebraic loops ...

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by