Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
How to use level 2 s function block more than once in a model without overwriting values from each block?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, I have a simple question. I want to realize a model for a pipe system with numerous level 2 s function blocks which are describing the single pipe sections. Each s function block gets different values for length, diameter, ect. In the s function I can store these values in the Dwork vector as follows:
block.Dwork(1).Name = 'Length';
block.Dwork(1).Dimensions = N;
block.Dwork(1).DatatypeID = 0; % double
block.Dwork(1).Complexity = 'Real'; % real
block.Dwork(1).UsedAsDiscState = true;
L=block.DialogPrm(1).Data;
block.Dwork(1).Data=L;
But if I have more than one Level 2 s functions than I also have block.Dwork(1) - vectors more often in my model. How can I get sure this Dwork vector don't gets overwritten by every single Level 2 s function block? Maybe I can change the expression 'block' in every s function block like: block1.Dwork(1), block2.Dwork(1), block3.Dwork(3) .
Unfortunately, in this case I need different Level 2 s functions for every single block I insert in my Simulink model. Would be great if someone could explain to me how the storage of variables works if there is a Level 2 s function block more than once in a model of Simulink.
Thanks!
0 Kommentare
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!