Subsections


Scilab

\epsfig{file=scifunc_block.eps,width=90.00pt}

Library

Others

Description

This block can realize any type of Scicos block. The function of the block is defined interactively using dialogue boxes and in Scilab language. During simulation, these instructions are interpreted by Scilab; the simulation of diagrams that include these types of blocks is slower. For more information see Scicos reference manual.

Dialog Box

Set scifunc_block parameters
input ports sizes 1
output port sizes 1
input event ports sizes []
output events ports sizes []
initial continuous state []
initial discrete state []
System parameters vector []
initial firing vector ($ <$0 for no firing) []
is block always active (0:no, 1:yes) 0

Default properties

Interfacing function

scilab/macros/scicos_blocks/misc/scifunc_block.sci

Computational function (type 3)


      subroutine scifunc(mlhs,mrhs)
c     execute scilab function with mrhs input args and mlhs output
c     variables
c     input args are supposed to be stored in the top of the stack
c     at positions top-mrhs+1:top
c     function adress is given by the integer ptr in the common /scsptr/
c
c     Copyright INRIA
      include "../stack.h"
      integer ptr
      integer mlhs,mrhs
      integer iadr
      logical allowptr
C
      common /scsptr/ ptr   
c
      iadr(l) = l + l - 1
c   

C     macro execution 
C     
      pt = pt + 1
      if (pt .gt. psiz) then
        call error(26)
        goto 9999
      endif
      ids(1,pt) = lhs
      ids(2,pt) = rhs
      rstk(pt) = 1001
      lhs = mlhs
      rhs = mrhs
      niv = niv + 1
      fun = 0
      fin = ptr
C     
      icall = 5
      krec = -1
      include "../callinter.h"
 200  lhs = ids(1,pt)
      rhs = ids(2,pt)
      pt = pt - 1
      niv = niv - 1
C+    
 9999 continue
      iero=1
      niv=niv-1
      return
      end

Ramine Nikoukhah 2004-06-22