How to create a new Module
As example a new module will be created, which can be used to read out the actual settungs of axis and buttons of a joystick. In the tutorial How to create a new Module the creation of a joystick scicos block will be descripted. The external library libSDL is used for access the joystick.
The step of creating a new module is quite simple and fast. Just do the following steps (you need an installed HART-toolbox!):
- start scilab
- start the HART-Toolbox
- run the module_creator function of the HART-Toolbox
- select demos
- Press OK
Configure the new Module
- Now you can put your computational functions to ../src/c
- If you want to use the codegeneration for RTAI, then you can put files to ../src/c_RTAI
- Generate interface functions for your scicos blocks and put them to ../macros
- Generate help files and put them to ../help/en_US (scilab5) or ../help/en_US_scilab4 (scilab4)
- Configure the configure.sce file.
- Rebuild the HART-Toolbox!
The configure.sce script
- In the build process of the HART-Toolbox, the configure.sce script of each module will started.
- This script is importend for the correct building and embedding of the c/c++ - code from each module
- You can decide if the module should be build or not by setting the variable buildable to 'no' or to 'yes'.
- Add all names of each computational function to names variable:
- Add all C/C++ files that should be compiled. (Replace the ending by .o)
- If any external library is needed for compilation add this to ldflags
- If spezial flags or include directories are needed, add them to cflags
buildable='yes'; //change to no, if the module should not be build
ldflags = " -lspezial_lib";
cflags = " -I/special/include -DFLAG_HALLO=1";