Hardware Access in Real-Time for scilab/scicos
WORKS ONLY with SCILAB 4.1.2!!!
scilab
scicos
- Open the sources palette
- Select the activation clock and add it to the scicos-diagramm
- Open the HART RTAI palette
- Select the sin generator and add it to the scicos-diagramm
- Select the scope and add it to the scicos-diagramm
- Connect the sine output with the scope input
- Connect the output of the clock with the sine and the scope activation input
- Select region to super block
- Draw a rectangle over the sine generator and the scope block
- Change the Period of the activation clock to 1 msec
- Save the diagram as demo1.cos
- Open the Super block
- Rename the superblock to demo
- Close the super block
- Select Code generation from the menu
- Click on the super block
- Change the file path if needed
- If everthing works properly, the output in the scilab main window should be like this one:
- Scilab / Scicos 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
- Start QRtailab
- Click on Target/Connect
- Clock on View/Scope
- Enable the scope by clicking on Show/Hide
- Stop the program by clicking on Target/Stop
- Close Qrtailab
Gratulation! You have generated your first real time program.