Sample menu:

news:

03 Juli 2013:
hart_0.4.5 released!

sourceforge project site »

CSS ist valide!

Valid XHTML 1.0 Strict

SourceForge.net Logo

RTAI navigation

RTAI Codegenration

Please follow Installation!. In the following a example will be presented on such installed environment!

For SCILAB 5.4.1!!!

1. Starting scilab 5.4.1
scilab
2. Loading HART-Toolbox
rtai palette
3. Starting xcos
xcos
rtai palette
4. Adding blocks to the xcos diagramm
  • Open the sources palette
  • Select the activation clock and add it to the xcos-diagramm
  • Open the HART RTAI palette
  • Select the sin generator and add it to the xcos-diagramm
  • Select the scope and add it to the xcos-diagramm
rtai palette
  • Connect the sine output with the scope input
  • Connect the output of the clock with the sine and the scope activation input
  • Draw a rectangle over the sine generator and the scope block
  • Select region to superblock
rtai palette
  • Rename the superblock to demo by selecting the block and go to Format and edit
rtai palette
  • Enter "demo" into Text settings
rtai palette
  • Change the Period of the activation clock to 1 msec
  • Save the diagram as demo1.cos
  • Select Simulation and then Compile
rtai palette rtai palette
  • Go to the scilab console
  • Start Code geneartion by entering RTCodeGen()
  • Select Ok in the dialog window.
rtai palette
  • If everthing works properly, the output in the scilab main window should be like this one:
rtai palette
  • Scilab / xcos can be closed
  • Open a terminal and go to the directory with the generated code
  • Be shure, that all rtai modules are loaded properly
  • start the program: ./demo -o
  • the -o options enforces the oneshot mode, which works better for same systems and slow sampling rates (<10kHz).

rtai palette
  • Start QRtailab
  • Click on Target/Connect
  • Clock on View/Scope
  • Enable the scope by clicking on Show/Hide
rtai palette
  • Stop the program by clicking on Target/Stop
  • Close Qrtailab

Gratulation! You have generated your first real time program.