[scilab-Users] compiling c block with LCC

Roberto Bucher roberto.bucher at supsi.ch
Tue Nov 24 20:50:27 CET 2009


Try to cmodify as some parts as following

...
if(flag==1){
double *y = block->outptr[0];
y[0] = block->x[0];
...
double *M = block->inptr[0];
...

block->xd[1]=1/m/l/l*(g*l*cos(phi)*m-c*phi-M[0]-d*omega);
...

Regards

Roberto Bucher

On Tuesday 24 November 2009 19:09:39 trendic at gmx.de wrote:
> Hi,
> 
> Even if there is an error in the code I dont understand the
>  Warnings/errors. This is the example Code:
> 
> #include <scicos/scicos_block.h>
> #include <math.h>
> void pendel_c(scicos_block *block, int flag) {
> if(flag==1){
> block->outptr[0][0]=block->x[0];
> }
> if(flag==0){
> double g=9.81;
> double m = block->rpar[0];
> double l = block->rpar[1];
> double c = block->rpar[2];
> double d = block->rpar[3];
> double phi=block->x[0]; //phi
> double omega=block->x[1]; //omega
> double M = block->inptr[0][0];
> block->xd[0]=block->x[1];
> block->xd[1]=1/m/l/l*(g*l*cos(phi)*m-c*phi-M-d*omega);
> }
> }
> 
> 
> I have tried to insert the Code in a block and tried the command
> 
> ilib_for_link('pendel_c','pendel.o',[],'c');
> 
> best regards
> 
> -------- Original-Nachricht --------
> 
> > Datum: Tue, 24 Nov 2009 12:01:29 +0100
> > Von: "Allan CORNET" <allan.cornet at scilab.org>
> > An: users at lists.scilab.org
> > Betreff: RE: [scilab-Users] compiling c block with LCC
> >
> > Hi,
> >
> > Can you attach your diagram (example) ?
> >
> > Thanks you
> >
> > --
> > -------------------------
> > Allan CORNET
> > -------------------------
> > The Scilab Consortium
> > Digiteo
> > Domaine de Voluceau
> > Rocquencourt - B.P. 105
> > 78153 Le Chesnay Cedex
> > France
> >
> > -----Message d'origine-----
> > De : trendic at gmx.de [mailto:trendic at gmx.de]
> > Envoyé : mardi 24 novembre 2009 11:48
> > À : users at lists.scilab.org
> > Objet : [scilab-Users] compiling c block with LCC
> >
> > Hello,
> >
> > Does anyone know how to compile and link a c block for scicos?
> >
> > I have tried with the Blocks in the Palette "user defined functions" but
> > I get errors with that. At first I recieve the warning:
> >
> > C:/SCILAB~1/modules/dynamic_link/src/scripts/TEMPLATE_MAKEFILE.LCCnot
> > found.
> >
> > which is surprising since there is a file with that name at exactly that
> > position. I further get the Message
> >
> > Can't open Makelib.lcc
> >
> > After that:
> >
> > unix_s: error during "make -f Makelib.lcc all" execution ...
> >
> > Is the command unix_s correct although I am working on windows?
> >
> > I have googled around and found someone who says that you can compile
> > Functions similar to S-Functions in Matlab by the ilib_for_link command.
> >
> > I have tried that with an example c-File which delivers exactly the same
> > Warnings/Errors as mentioned above.
> >
> >
> > Another question I have is: when I edit system functions as
> > "ilib_for_link.sci" e.g. how is the corresponding ilib_for_link.bin file
> > created?
> >
> > Thanks for any advise in advance
> >
> > Olaf
> 

-- 
University of Applied Sciences of Southern Switzerland
Dept. Innovative Technologies
CH-6928 Lugano-Manno
http://web.dti.supsi.ch/~bucher



More information about the users mailing list