Reputation: 495
I have the following problem:
Matlab/Simulink gives me the warning:
Warning: The block 'Data Store Write1' is writing to the data store 'Data Store' but the block(s) 'Data Store Write2' have already written to a portion or the entire region of this memory at time t
This is because of my model looking like this:
Inside the Stateflow chart the code is:
[hasChanged(In)] {Out = In;}
So my question is: Is there an option or something else the Data Store Write blocks are write only on change?
Annotations:
The value "Out" is changed in the Stateflow Chart sometimes, but not in every step, and I need this "feedback" stored in Data Store. So I can read/link on the value of Data Store.
I need to change the value from outside with the constant block.
Upvotes: 0
Views: 2240
Reputation: 495
The most satisfying solution I found, was to build an own 'write-only-on-change" block and add it to the library:
These three pictures show the structure of the block from outer to inner:
The subsystem is triggered on rising signals from the change detection block. Also I added a mask to specify where to save the signal (data store/bus name).
Upvotes: 1