Difference between "Model" and "Diagram"


We can set a variable in the 'Model' and 'Diagram'.
Can you explain what is the difference and where the variables are possible to use?
It looks like there are difference between 'Model' and 'Diagram' variable's are used.
Answers
-
Hi Seoksan,
The difference is in the visibility/accessability. Variables defined in 'Model' can be accessed from everywhere, variables defined in 'Diagram' can only be accessed in the corresponding context of the model or below. It's only important when you use Supercomponents, otherwise you just have one context in your model. Every Supercomponent has its own context.
Regards,
Ronald0 -
Hi Seoksan,
An example on what Ronald described:
A variable defined in the model initialization can be used in the simulation setup, it is not the case if it is defined in the diagram context (top level).
Thanks
Fady
0 -
Thank you, Fady and Ronald.
0