Hi Bram,
here is a step by step guide on how to add a new block to the Scicos-Flex palette. They are just notes taken while I was doing it, and are a result of a few mail exchanges tonight with Roberto.
Of course, all the thanks goes to Roberto Bucher for all this, not to me
The steps
-------------------------------
0) Preface
0.a) Directory names are the directory names of my laptop...
0.b) Use the zip file attached. for each step, there are a few files to look at

0.c) I had to edit the post to substitute backslash with slashes
1) NMake
1.a) install NMake from
http://support.microsoft.com/default.as ... us;Q132084
1.b) rename the executable file in nmake.exe and copy it into C:/Windows
2) Update the files
2.a) copy dspic_getfreq.sci into
C:/Programmi/scilab-4.1.1/contrib/dspic/macros
2.b) add into the C:/Programmi/scilab-4.1.1/contrib/dspic/macros/name
one line with the file name
2.c) in C:/Programmi/scilab-4.1.1/contrib/dspic/bulder.sce , we have to
comment a few lines, because we are not going to compile the .c files
distributed with the package. in particular, comment from the line
\"cd(ROUTINES)\"
to the one but last line (leave only the \"cd(\'..\')\"
3) Compile
3.a) open scilab 4.1.1
3.b) from the scilab console, \"cd c:/Programmi/scilab-4.1.1/contrib/dspic\"
3.c) from the scilab console, \"exec builder.sce\"
3.d) you get the following output
--------------------------------------------------------------------
___________________________________________
scilab-4.1.1
Copyright (c) 1989-2007
Consortium Scilab (INRIA, ENPC)
___________________________________________
Startup execution:
loading initial environment
shared archive loaded
Link done
Scicos-FLEX Ready
-->cd c:/Programmi/scilab-4.1.1/contrib/dspic
ans =
c:/Programmi/scilab-4.1.1/contrib/dspic
-->exec builder.sce
-->mode(-1);
-->
--------------------------------------------------------------------
4) Add the block to the scicos Palette
4.a) \"cd macros\"
4.b) open scicos by typing \"scicos();\"
4.c) Menu \"Diagram/Load\", load the file \"dspic.cosf\"
4.d) Menu \"Edit/Add New block\", specify the file name \"dspic_getfreq\", press ok and place the block inside the palette where you want
4.e) menu \"Diagram/Save As\", and give the name \"dspic.cosf\" - with the final \"f\"!!!
4.f) close Scicos and Scilab
4.g) now if you open again scicos, the dspic palette should have the dspic_getfreq block.
5) Configuring Erika Enterprise
5.a) copy the getfreq.c file inside \"C:/Programmi/Evidence/ee/contrib/scicos/src/pic30\"
5.b) add getfreq.c inside \"C:/Programmi/Evidence/ee/contrib/scicos/cfg/cfg.mk\" (see file attached for an example)
6) Create a scicos example
6.a) Follow the Scicos tutorial, but use the getfreq instead of the Sine (see files in the zip)
6.b) compile and enjoy
--------------------------------------------------
Enjoy
PJ