22
22
* See the file ./license.txt
24
24
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="sci_struct">
26
<refname>sci_struct</refname>
27
<refpurpose>Scicos block structure of a scilab computational function</refpurpose>
29
<refsection id="Contents_sci_struct">
30
<title>Contents</title>
34
<link linkend="sci_struct">sci_struct - Scicos block structure of a scilab computational function</link>
41
<xref linkend="Module_sci_struct">Module</xref>
46
<xref linkend="Description_sci_struct">Description</xref>
51
<xref linkend="Inputsoutputs_sci_struct">Inputs/outputs</xref>
56
<xref linkend="Events_sci_struct">Events</xref>
61
<xref linkend="Parameters_sci_struct">Parameters</xref>
66
<xref linkend="States_sci_struct">States</xref>
71
<xref linkend="Zerocrossingsurfacesandmodes_sci_struct">Zero crossing surfaces and modes</xref>
76
<xref linkend="Miscallaneous_sci_struct">Miscallaneous</xref>
83
<refsection id="Module_sci_struct">
88
<link linkend="xcos">xcos</link>
93
<refsection id="Description_sci_struct">
94
<title>Description</title>
96
A Scicos computational function of type 5 can be realized by the use of a Scilab function.
97
That function does not really differs from all other scilab function : one can use all functions and
98
instructions of the scilab language inside that function to do the computation.
101
Such a function must be written in a file with extension .sci, must be loaded inside scilab by the
102
common loading scilab function (, , , ,...) and must have
103
two right hand side arguments and one left hand side argument, as the following calling sequence :
109
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
110
for more details about the C structure of scicos
114
That scilab structure is a scilab typed list variable that have the following fields :
120
Each fields are then accessible inside the scilab computational function by the use of :
129
<refsection id="Inputsoutputs_sci_struct">
130
<title>Inputs/outputs</title>
137
<emphasis role="bold">block.nin :</emphasis> a scalar that gives the number of regular input ports. This is a read only data.
142
<emphasis role="bold">block.insz :</emphasis> a vector of size , that gives the dimensions and types of the regular input ports.
147
<emphasis role="bold"> :</emphasis> are the first dimensions.
152
<emphasis role="bold"> :</emphasis> are the second dimensions.
157
<emphasis role="bold"> :</emphasis> are the type of data (C coding).
162
<para> This is a read only data. </para>
166
<emphasis role="bold">block.inptr :</emphasis> 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 .
168
<para> The data type that can be provided by regular input ports are :</para>
172
<emphasis role="bold">1:</emphasis> matrix of real numbers,
177
<emphasis role="bold">2:</emphasis> matrix of complex numbers,
182
<emphasis role="bold">3:</emphasis> matrix of int32 numbers,
187
<emphasis role="bold">4:</emphasis> matrix of int16 numbers,
192
<emphasis role="bold">5:</emphasis> matrix of int8 numbers,
197
<emphasis role="bold">6:</emphasis> matrix of uint32 numbers,
202
<emphasis role="bold">7:</emphasis> matrix of uint16 numbers,
207
<emphasis role="bold">8:</emphasis> matrix of uint8 numbers.
212
<para> This is a read only data. </para>
216
<emphasis role="bold">block.nout :</emphasis> a scalar that gives the number of regular output ports. This is a read only data.
221
<emphasis role="bold">block.outsz :</emphasis> a vector of size , that gives the dimensions and types of the regular output ports.
226
<emphasis role="bold"> :</emphasis> are the first dimensions.
231
<emphasis role="bold"> :</emphasis> are the second dimensions.
236
<emphasis role="bold"> :</emphasis> are the type of data (C coding).
241
<para> This is a read only data. </para>
245
<emphasis role="bold">block.outptr :</emphasis> 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 .
247
<para> The data type that can be provided by regular output ports are :</para>
251
<emphasis role="bold">1:</emphasis> matrix of real numbers,
256
<emphasis role="bold">2:</emphasis> matrix of complex numbers,
261
<emphasis role="bold">3:</emphasis> matrix of int32 numbers,
266
<emphasis role="bold">4:</emphasis> matrix of int16 numbers,
271
<emphasis role="bold">5:</emphasis> matrix of int8 numbers,
276
<emphasis role="bold">6:</emphasis> matrix of uint32 numbers,
281
<emphasis role="bold">7:</emphasis> matrix of uint16 numbers,
286
<emphasis role="bold">8:</emphasis> matrix of uint8 numbers.
292
Values of regular output ports will be saved in the<link linkend="C_struct">Cstructure</link> of the block only for =6 and =1.
300
<refsection id="Events_sci_struct">
301
<title>Events</title>
308
<emphasis role="bold">block.nevprt :</emphasis> a scalar given the event input port number (binary coding) which have activated the block. This is a read only data.
313
<emphasis role="bold">block.nevout :</emphasis> a scalar given the number of output event port of the block. This is a read only data.
318
<emphasis role="bold">block.evout :</emphasis> a vector of size corresponding to the register of output event. Values of output event register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =3.
326
<refsection id="Parameters_sci_struct">
327
<title>Arguments</title>
334
<emphasis role="bold">block.nrpar :</emphasis> a scalar given the number of real parameters. This is a read only data.
339
<emphasis role="bold">block.rpar :</emphasis> a vector of size corresponding to the real parameter register. This is a read only data.
344
<emphasis role="bold">block.nipar :</emphasis> a scalar given the number of integer parameters. This is a read only data.
349
<emphasis role="bold">block.ipar :</emphasis> a vector of size correspondig to the integer parameter register. This is a read only data.
354
<emphasis role="bold">block.nopar :</emphasis> a scalar given the number of object parameters. This is a read only data.
359
<emphasis role="bold">block.oparsz :</emphasis> a matrix of size , that respectively gives the first and the second dimension of object parameters. This is a read only data.
364
<emphasis role="bold">block.opartyp :</emphasis> a vector of size given the C coding type of data. This is a read only data.
369
<emphasis role="bold">block.opar :</emphasis> a list of size given the values of object parameters. Each element of can be either a typed matrix or a list. Only matrix that encloses numbers of type real, complex, int32, int16, int8, uint32, uint16 and uint8 are allowed, all other types of scilab data will be enclosed in a sub-list. This is a read only data.
377
<refsection id="States_sci_struct">
378
<title>States</title>
385
<emphasis role="bold">block.nz :</emphasis> a scalar given the number of discrete state for the block. This is a read only data.
390
<emphasis role="bold">block.z :</emphasis> a vector of size corresponding to the discrete state register. Values of discrete state register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =4, =6, =2 and =5.
395
<emphasis role="bold">block.noz :</emphasis> a scalar that gives the number of discrete object state. This is a read only data.
400
<emphasis role="bold">block.ozsz :</emphasis> a matrix of size , that respectively gives the first and the second dimension of discrete object state. This is a read only data.
405
<emphasis role="bold">block.oztyp :</emphasis> a vector of size given the C coding type of data.
410
<emphasis role="bold">block.oz :</emphasis> a list of size given the values of discrete object states. Each element of can be either a typed matrix or a list. Only matrix that encloses numbers of type real, complex, int32, int16, int8, uint32, uint16 and uint8 are allowed, all other types of scilab data will be enclosed in a sub-list. Values of discrete object state will be saved in the<link linkend="C_struct">C structure</link> of the block only for =4, =6, =2 and =5.
415
<emphasis role="bold">block.nx :</emphasis> a scalar given the number of continuous state for the block. This is a read only data.
420
<emphasis role="bold">block.x :</emphasis> a vector of size given the value of the continuous state register. Values of the continuous state register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =4, =6 and =2.
425
<emphasis role="bold">block.xd :</emphasis> a vector of size given the value of the derivative continuous state register. Values of the derivative continuous state register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =4, =6, =0 and =2.
430
<emphasis role="bold">block.res :</emphasis> a vector of size corresponding to the Differential Algebraic Equation (DAE) residual. Values of that register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =0, and =10.
438
<refsection id="Zerocrossingsurfacesandmodes_sci_struct">
439
<title>Zero crossing surfaces and modes</title>
446
<emphasis role="bold">block.ng :</emphasis> a scalar given the number of zero crossing surfaces for the block. This is a read only data.
451
<emphasis role="bold">block.g :</emphasis> a vector of size corresponding to the zero crossing register. Values of that register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =9.
456
<emphasis role="bold">block.nmode :</emphasis> a scalar given the number of mode for the block. This is a read only data.
461
<emphasis role="bold">block.mode :</emphasis> a vector of size that corresponds to the mode register. Values of that register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =9, with =1.
469
<refsection id="Miscallaneous_sci_struct">
470
<title>Miscallaneous</title>
477
<emphasis role="bold">block.type :</emphasis> a scalar given the type of the block. This is a read only data.
482
<emphasis role="bold">block.label :</emphasis> a string given the label of the block. This is a read only data.
26
<refname>sci_struct</refname>
27
<refpurpose>Scicos block structure of a scilab computational function</refpurpose>
29
<refsection id="Contents_sci_struct">
30
<title>Contents</title>
34
<link linkend="sci_struct">sci_struct - Scicos block structure of a scilab computational function</link>
41
<xref linkend="Module_sci_struct">Module</xref>
46
<xref linkend="Description_sci_struct">Description</xref>
51
<xref linkend="Inputsoutputs_sci_struct">Inputs/outputs</xref>
56
<xref linkend="Events_sci_struct">Events</xref>
61
<xref linkend="Parameters_sci_struct">Parameters</xref>
66
<xref linkend="States_sci_struct">States</xref>
71
<xref linkend="Zerocrossingsurfacesandmodes_sci_struct">Zero crossing surfaces and modes</xref>
76
<xref linkend="Miscallaneous_sci_struct">Miscallaneous</xref>
83
<refsection id="Module_sci_struct">
88
<link linkend="xcos">xcos</link>
93
<refsection id="Description_sci_struct">
94
<title>Description</title>
96
A Scicos computational function of type 5 can be realized by the use of a Scilab function.
97
That function does not really differs from all other scilab function : one can use all functions and
98
instructions of the scilab language inside that function to do the computation.
101
Such a function must be written in a file with extension .sci, must be loaded inside scilab by the
102
common loading scilab function (, , , ,...) and must have
103
two right hand side arguments and one left hand side argument, as the following calling sequence :
109
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
110
for more details about the C structure of scicos
114
That scilab structure is a scilab typed list variable that have the following fields :
120
Each fields are then accessible inside the scilab computational function by the use of :
129
<refsection id="Inputsoutputs_sci_struct">
130
<title>Inputs/outputs</title>
137
<emphasis role="bold">block.nin :</emphasis> a scalar that gives the number of regular input ports. This is a read only data.
142
<emphasis role="bold">block.insz :</emphasis> a vector of size , that gives the dimensions and types of the regular input ports.
147
<emphasis role="bold"> :</emphasis> are the first dimensions.
152
<emphasis role="bold"> :</emphasis> are the second dimensions.
157
<emphasis role="bold"> :</emphasis> are the type of data (C coding).
162
<para> This is a read only data. </para>
166
<emphasis role="bold">block.inptr :</emphasis> 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 .
168
<para> The data type that can be provided by regular input ports are :</para>
172
<emphasis role="bold">1:</emphasis> matrix of real numbers,
177
<emphasis role="bold">2:</emphasis> matrix of complex numbers,
182
<emphasis role="bold">3:</emphasis> matrix of int32 numbers,
187
<emphasis role="bold">4:</emphasis> matrix of int16 numbers,
192
<emphasis role="bold">5:</emphasis> matrix of int8 numbers,
197
<emphasis role="bold">6:</emphasis> matrix of uint32 numbers,
202
<emphasis role="bold">7:</emphasis> matrix of uint16 numbers,
207
<emphasis role="bold">8:</emphasis> matrix of uint8 numbers.
212
<para> This is a read only data. </para>
216
<emphasis role="bold">block.nout :</emphasis> a scalar that gives the number of regular output ports. This is a read only data.
221
<emphasis role="bold">block.outsz :</emphasis> a vector of size , that gives the dimensions and types of the regular output ports.
226
<emphasis role="bold"> :</emphasis> are the first dimensions.
231
<emphasis role="bold"> :</emphasis> are the second dimensions.
236
<emphasis role="bold"> :</emphasis> are the type of data (C coding).
241
<para> This is a read only data. </para>
245
<emphasis role="bold">block.outptr :</emphasis> 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 .
247
<para> The data type that can be provided by regular output ports are :</para>
251
<emphasis role="bold">1:</emphasis> matrix of real numbers,
256
<emphasis role="bold">2:</emphasis> matrix of complex numbers,
261
<emphasis role="bold">3:</emphasis> matrix of int32 numbers,
266
<emphasis role="bold">4:</emphasis> matrix of int16 numbers,
271
<emphasis role="bold">5:</emphasis> matrix of int8 numbers,
276
<emphasis role="bold">6:</emphasis> matrix of uint32 numbers,
281
<emphasis role="bold">7:</emphasis> matrix of uint16 numbers,
286
<emphasis role="bold">8:</emphasis> matrix of uint8 numbers.
292
Values of regular output ports will be saved in the<link linkend="C_struct">Cstructure</link> of the block only for =6 and =1.
300
<refsection id="Events_sci_struct">
301
<title>Events</title>
308
<emphasis role="bold">block.nevprt :</emphasis> a scalar given the event input port number (binary coding) which have activated the block. This is a read only data.
313
<emphasis role="bold">block.nevout :</emphasis> a scalar given the number of output event port of the block. This is a read only data.
318
<emphasis role="bold">block.evout :</emphasis> a vector of size corresponding to the register of output event. Values of output event register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =3.
326
<refsection id="Parameters_sci_struct">
327
<title>Arguments</title>
334
<emphasis role="bold">block.nrpar :</emphasis> a scalar given the number of real parameters. This is a read only data.
339
<emphasis role="bold">block.rpar :</emphasis> a vector of size corresponding to the real parameter register. This is a read only data.
344
<emphasis role="bold">block.nipar :</emphasis> a scalar given the number of integer parameters. This is a read only data.
349
<emphasis role="bold">block.ipar :</emphasis> a vector of size correspondig to the integer parameter register. This is a read only data.
354
<emphasis role="bold">block.nopar :</emphasis> a scalar given the number of object parameters. This is a read only data.
359
<emphasis role="bold">block.oparsz :</emphasis> a matrix of size , that respectively gives the first and the second dimension of object parameters. This is a read only data.
364
<emphasis role="bold">block.opartyp :</emphasis> a vector of size given the C coding type of data. This is a read only data.
369
<emphasis role="bold">block.opar :</emphasis> a list of size given the values of object parameters. Each element of can be either a typed matrix or a list. Only matrix that encloses numbers of type real, complex, int32, int16, int8, uint32, uint16 and uint8 are allowed, all other types of scilab data will be enclosed in a sub-list. This is a read only data.
377
<refsection id="States_sci_struct">
378
<title>States</title>
385
<emphasis role="bold">block.nz :</emphasis> a scalar given the number of discrete state for the block. This is a read only data.
390
<emphasis role="bold">block.z :</emphasis> a vector of size corresponding to the discrete state register. Values of discrete state register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =4, =6, =2 and =5.
395
<emphasis role="bold">block.noz :</emphasis> a scalar that gives the number of discrete object state. This is a read only data.
400
<emphasis role="bold">block.ozsz :</emphasis> a matrix of size , that respectively gives the first and the second dimension of discrete object state. This is a read only data.
405
<emphasis role="bold">block.oztyp :</emphasis> a vector of size given the C coding type of data.
410
<emphasis role="bold">block.oz :</emphasis> a list of size given the values of discrete object states. Each element of can be either a typed matrix or a list. Only matrix that encloses numbers of type real, complex, int32, int16, int8, uint32, uint16 and uint8 are allowed, all other types of scilab data will be enclosed in a sub-list. Values of discrete object state will be saved in the<link linkend="C_struct">C structure</link> of the block only for =4, =6, =2 and =5.
415
<emphasis role="bold">block.nx :</emphasis> a scalar given the number of continuous state for the block. This is a read only data.
420
<emphasis role="bold">block.x :</emphasis> a vector of size given the value of the continuous state register. Values of the continuous state register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =4, =6 and =2.
425
<emphasis role="bold">block.xd :</emphasis> a vector of size given the value of the derivative continuous state register. Values of the derivative continuous state register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =4, =6, =0 and =2.
430
<emphasis role="bold">block.res :</emphasis> a vector of size corresponding to the Differential Algebraic Equation (DAE) residual. Values of that register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =0, and =10.
438
<refsection id="Zerocrossingsurfacesandmodes_sci_struct">
439
<title>Zero crossing surfaces and modes</title>
446
<emphasis role="bold">block.ng :</emphasis> a scalar given the number of zero crossing surfaces for the block. This is a read only data.
451
<emphasis role="bold">block.g :</emphasis> a vector of size corresponding to the zero crossing register. Values of that register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =9.
456
<emphasis role="bold">block.nmode :</emphasis> a scalar given the number of mode for the block. This is a read only data.
461
<emphasis role="bold">block.mode :</emphasis> a vector of size that corresponds to the mode register. Values of that register will be saved in the<link linkend="C_struct">C structure</link> of the block only for =9, with =1.
469
<refsection id="Miscallaneous_sci_struct">
470
<title>Miscallaneous</title>
477
<emphasis role="bold">block.type :</emphasis> a scalar given the type of the block. This is a read only data.
482
<emphasis role="bold">block.label :</emphasis> a string given the label of the block. This is a read only data.