Data store memory (read/write) is used for getting the Error to switch between two values.
Instead, why can't thegoto–from blocks be used ?
Best Answer
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.
They are completely different. From/Goto is for flow control, "Send this signal to another part of the model that I have described somewhere else". DSM holds on to information until the information is replaced, able to retrieve the information whenever it is asked for. DSM corresponds to storing something into a variable.
This is on that page. Create A=Simulink.Signal in base workspace, then you can use DataStoreRead or DataStoreWrite block with data store name as "A" anywhere.
You can use Simulink.Signalobjects in addition to, or instead of,Data Store Memoryblocks to define data stores. A data store defined in thebaseworkspace with a signal object is aglobaldata store. Global data stores are accessible to every model, including all referenced models. SeeData Storesfor more information.
Best Answer