How to add a new Scicos block to ERIKA Enterprise

From ErikaWiki

(Difference between revisions)
Jump to: navigation, search

Revision as of 21:27, 22 June 2008

These are a few notes useful if you want to create a new block in Scicos and the corresponding implementation function in ERIKA Enterprise.

This information derives from a post in the ERIKA Forum, and applies an old version of the Scilab toolbox (still to be tested on the latest one!)

  1. Preface
    1. Directory names are the directory names of my laptop...
    2. Use the zip file attached. for each step, there are a few files to look at
    3. I had to edit the post to substitute backslash with slashes
  2. NMake
    1. install NMake from;en-us;Q132084
    2. rename the executable file in nmake.exe and copy it into C:/Windows
  3. Update the files
    1. You need to create the block file. You can use Roberto's block editor . Or check out the block example at,com_fireboard/Itemid,262/func,view/id,6/catid,3/
    2. add into the C:/Programmi/scilab-4.1.1/contrib/dspic/macros/name one line with the file name
    3. 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('..')"
  4. Compile
    1. open scilab 4.1.1
    2. from the scilab console, "cd c:/Programmi/scilab-4.1.1/contrib/dspic"
    3. from the scilab console, "exec builder.sce"
  5. you get the following output
    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 =
    -->exec builder.sce
  6. Add the block to the scicos Palette
    1. "cd macros"
    2. open scicos by typing "scicos();"
    3. Menu "Diagram/Load", load the file "dspic.cosf"
    4. Menu "Edit/Add New block", specify the file name "dspic_getfreq", press ok and place the block inside the palette where you want
    5. menu "Diagram/Save As", and give the name "dspic.cosf" - with the final "f"!!!
    6. close Scicos and Scilab
    7. now if you open again scicos, the dspic palette should have the dspic_getfreq block.
  7. Configuring Erika Enterprise
    1. copy the getfreq.c file inside "C:/Programmi/Evidence/ee/contrib/scicos/src/pic30"
    2. add getfreq.c inside "C:/Programmi/Evidence/ee/contrib/scicos/cfg/" (see file attached for an example)
  8. Create a scicos example
    1. Follow the Scicos tutorial, but use the getfreq instead of the Sine (see files in the zip)
    2. compile and enjoy!
Personal tools