These parameters, which we refer to as GUI parameters, are not necessarily the exact duplicate of the block parameters used in the computational function of the block used during simulation. For example the GUI parameters of a linear system block can be the numerator and the denominator of its transfer function, whereas the parameters used during the simulation are the A, B, C and D matrices associated with the time domain specification of this transfer function. It is the role of the interfacing function of the block to examine the GUI parameters given by the user, generate error messages if needed, and convert them into simulation parameters.
In specifying the GUI parameters, the user can enter numerical expressions in the dialog box, for example 23 or [1,4;0,2], but he can also enter Scilab expressions such as: exp(.4*3)+sin(.3) or ones(5,5)+diag([1:5]). But more importantly, the user can enter expressions using Scilab variables: A, cos(theta)/2. These variables, which we call symbolic parameters of the block, must have been previously defined; in most cases this is done in a context.
Using symbolic parameters in specifying GUI parameters allows the user to easily change a system parameter affecting multiple blocks (otherwise the GUI parameter of each block has to be individually changed). To make an analogy with standard programming languages such as C, it would be like setting double mass=0.3; and using mass everywhere in the program instead of 0.3. Symbolic parameters can also be used to construct parameterized models, for example it is possible to build the model of a fully generic linear-system-Kalman-filter system in which even the size of the blocks' states and input/outputs are not determined in advance and vary depending on the value of the parameters. Indeed, the sizes of the symbolic parameters can also be changed if it does not create inconsistencies in the diagram.
If the variable A is redefined in the context of Dn, one of the sub-diagrams of D1, then it is the new value that is available in the blocks of Dn, and the context and the blocks of the sub-diagrams below it. So in general, to find the definition of a symbolic parameter used in a block, first the context of the diagram containing the block must be examined. If the parameter is not defined there, the context of the diagram containing the first diagram must be examined and so on until the definition of the parameter is found.
This hierarchical treatment of parameter definition using multiple contexts as opposed to a single workspace has many advantages. The most important advantage is that a Super Block can be placed inside a diagram without any risk of conflict, even if symbolic parameters with similar names are used in both. Another advantage is its natural usage in the masking operation that we shall see later.
When a diagram is opened, its context is also evaluated so that symbolic parameters are made available in the environment. The GUI parameters of the blocks are however not re-evaluated. The reason is that it is assumed that two evaluation of the same identical contexts leads necessary to the same values of symbolic parameters. So, since the content of the context of the diagram has not changed since it has last been saved, the blocks GUI parameters must be up to date. This assumption holds in most cases, but not if functions such as rand or date are used in the context. Another instruction that can invalidate the assumption is the execution of an external script, for example exec('myprog.sce'). Clearly if the file myprog.sce is modified, the re-evaluation of the context can lead to different values for the symbolic parameters. Scicos attempts to identify the presence of such commands inside the text of the context and issues a full re-evaluation if it finds it necessary when a diagram is opened. But this identification is not full proof and a manual ``Evaluate'' button is provided to force a full re-evaluation if the user finds it necessary.
The ``Evaluate'' button is particularly useful when the context contains an exec command since Scicos does not know if the executed file is edited. In such a case, it is up to the user to force an evaluation.
Finally it should be noted that all the variables defined in a context, except for functions, are available as symbolic parameters. So it is recommended that intermediate variables used in the context be cleared at the end of the context to avoid overloading the list of symbolic parameters.
By choosing to define or not to define in the context various symbolic parameters needed in a Super Block, user can specify the GUI parameters of the block obtained after the masking operation. This is an easy way of constructing custom blocks. The dialog box associated with the block can also be customized using the ``Customize Mask'' operation. Finally, the mask can be removed by the ``Remove Mask'' operation.