Scilab Function
fr - eng


callblk - Call scicos computational function from scilab prompt

Module

Description

This function allows to call a computational function from a Scicos block structure. The fields of that structure must be properly informed before use it with callblk.
A simplified flowchart of how work callblk is shown in the following figure:

\begin{figure}\begin{center}
\scalebox{0.65}{%
\input{orgcallblk.pstex_t}}
\end{center}\end{figure}

From the input structure blk_in, a C scicos_blocks structure is allocated and informed, the pointer of the comptational function is found, and the computational function is then called with the C structure and the parameter flag. Finally an output scilab structure blk_out is created with the values contained in the C structure.
callblk can be used to do prototypes of code generator and simulator in Scilab language.

Calling Sequence

[blk]=callblk(blk,flag,time)

Parameters

Example

//Use of scope of fibo.cosf in Scilab
//15/07/08, AL
load SCI/macros/scicos/lib;
exec('SCI/demos/scicos/fibo.cosf',-1);
[ierr,scicos_ver,scs_m]=update_version(scs_m);
omod=scs_m.objs(10).model; //scope is the obj(10)
omod.in=1; //update in (because -1)
bl=model2blk(omod); //get a computational blk struct
// init
bl=callblk(bl,4,0);
// run
Tfin=120;
for i=0:1:Tfin*100
t=i/100;
//update regular input
bl.inptr(1)=0.55+cos(2*%pi/(15)*t)/10;
bl=callblk(bl,2,t); //calblk with flag=2
end
// finish
bl=callblk(bl,5,t);

See Also

Authors

Alan Layec INRIA