Scicos block structure of a scilab computational function
A Scicos computational function of type 5 can be realized by the use of a Scilab function. That function does not really differs from all other scilab function : one can use all functions and instructions of the scilab language inside that function to do the computation.
Such a function must be written in a file with extension .sci, must be loaded inside scilab by the common loading scilab function (, , , ,...) and must have two right hand side arguments and one left hand side argument, as the following calling sequence :
When the simulator is calling such a computational function, it build a scilab structure (in the previous exemple this is the named rhs/lhs arguments) from his own internal C reprensation of a block structure (see for more details about the C structure of scicos blocks).
That scilab structure is a scilab typed list variable that have the following fields :
Each fields are then accessible inside the scilab computational function by the use of :
block.nin : a scalar that gives the number of regular input ports. This is a read only data.
block.insz : a vector of size , that gives the dimensions and types of the regular input ports.
- : are the first dimensions.
- : are the second dimensions.
- : are the type of data (C coding).
This is a read only data.
block.inptr : a list of size that enclosed typed matrices for regular input ports. Each element correspond to only one regular input port. Then i-th matrix of the block.inptr list will have the dimensions [ , ] and the type . The data type that can be provided by regular input ports are :
- 1: matrix of real numbers,
- 2: matrix of complex numbers,
- 3: matrix of int32 numbers,
- 4: matrix of int16 numbers,
- 5: matrix of int8 numbers,
- 6: matrix of uint32 numbers,
- 7: matrix of uint16 numbers,
- 8: matrix of uint8 numbers.
This is a read only data.
block.nout : a scalar that gives the number of regular output ports. This is a read only data.
block.outsz : a vector of size , that gives the dimensions and types of the regular output ports.
- : are the first dimensions.
- : are the second dimensions.
- : are the type of data (C coding).
This is a read only data.
block.outptr : a list of size that enclosed typed matrices for regular output ports. Each element correspond to only one regular output port. Then i-th matrix of the block.outptr list will have the dimensions [ , ] and the type . The data type that can be provided by regular output ports are :
- 1: matrix of real numbers,
- 2: matrix of complex numbers,
- 3: matrix of int32 numbers,
- 4: matrix of int16 numbers,
- 5: matrix of int8 numbers,
- 6: matrix of uint32 numbers,
- 7: matrix of uint16 numbers,
- 8: matrix of uint8 numbers.
Values of regular output ports will be saved in the`Cstructure`_ of the block only for =6 and =1.