Hardware Access in Real-Time for scilab/scicos
echo deb http://www.linuxcnc.org/lucid lucid base emc2.4 > /tmp/linuxcnc.listReboot in the new installed RTAI-kernel.
echo deb-src http://www.linuxcnc.org/lucid lucid base emc2.4 >> /tmp/linuxcnc.list
sudo mv /tmp/linuxcnc.list /etc/apt/sources.list.d/
gpg --keyserver pgpkeys.mit.edu --recv-key 8F374FEF
gpg -a --export 8F374FEF | sudo apt-key add -
sudo apt-get update
sudo apt-get install linux-headers-2.6.32-122-rtai linux-image-2.6.32-122-rtai
cd /usr/src
sudo cvs -d:pserver:anonymous@cvs.gna.org:/cvs/rtai co magma
sudo ln -s magma rtai
cd /usr/src
sudo wget --no-check-certificate https://www.rtai.org/RTAI/rtai-3.8.1.tar.bz2
sudo tar xjvf rtai-3.8.1.tar.bz2
sudo ln -s rtai-3.8.1 rtai
cd /usr/src/rtaiEnsure directories are correct:
sudo make menuconfig
sudo makenow run export PATH=/usr/realtime/bin:$PATH for each open shell or do logout and login Now we need to load the rtai modules.
sudo make install
sudo sed -i 's/\(PATH=\"\)/\1\/usr\/realtime\/bin:/' /etc/environment
/sbin/insmod /usr/realtime/modules/rtai_smi.koCopy the lines to /usr/local/bin/start_rtai
/sbin/insmod /usr/realtime/modules/rtai_hal.ko
/sbin/insmod /usr/realtime/modules/rtai_lxrt.ko
/sbin/insmod /usr/realtime/modules/rtai_fifos.ko
/sbin/insmod /usr/realtime/modules/rtai_sem.ko
/sbin/insmod /usr/realtime/modules/rtai_mbx.ko
/sbin/insmod /usr/realtime/modules/rtai_msg.ko
/sbin/insmod /usr/realtime/modules/rtai_netrpc.ko
/sbin/insmod /usr/realtime/modules/rtai_shm.ko
cd /usr/local/src
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi login
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedi
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedilib
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedi_calibrate
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedi-nonfree-firmware
cd /usr/local/src/comedilib
sudo sh autogen.sh
sudo ./configure
sudo make
sudo make install
sudo mkdir /usr/local/include/linux
cd /usr/local/src/comedi
sudo sh autogen.sh
sudo ./configure --with-linuxdir=/usr/src/linux-headers-2.6.32-122-rtai --with-rtaidir=/usr/realtime
sudo make
sudo make install
sudo make dev
sudo ldconfig
cd /usr/local/src/comedi_calibrate
sudo autoreconf -i -B m4
sudo ./configure
sudo make
sudo make install
Under “Add-Ons”, select “Real Time COMEDI support in user space”
sudo cp /usr/local/src/comedi/include/linux/comedi.h /usr/local/include/
sudo cp /usr/local/src/comedi/include/linux/comedilib.h /usr/local/include/
sudo ln -s /usr/local/include/comedi.h /usr/local/include/linux/comedi.h
sudo ln -s /usr/local/include/comedilib.h /usr/local/include/linux/comedilib.h
cd /usr/src/rtai
sudo make menuconfig
sudo makeNow we need to load the comedi-modules. All rtai modules have to be loaded before! This is a example for the ni 6024e.
sudo make install
sudo cp /usr/local/src/comedilib/include/comedilib.h /usr/local/include/
modprobe comediCopy the lines to /usr/local/bin/load_daq
modprobe kcomedilib
modprobe comedi_fc
modprobe ni_mio_cs
insmod /usr/realtime/modules/rtai_comedi.ko
comedi_config -v /dev/comedi0 ni_mio_cs 0x0100
comedi_calibrate --calibrate
chmod a+rw /dev/comedi0
options comedi comedi_num_legacy_minors=4(you can change the number 4 if you want), or:
options comedi comedi_autoconfig=0The first option, comedi_num_legacy_minors=4 reserves 4 comedi devices for use by non-autoconfigured devices. The second option comedi_autoconfig=0 disables auto-configuration completely.
cd /opt
sudo wget http://www.scilab.org/download/4.1.2/scilab-4.1.2.bin.linux-i686.tar.gz
sudo tar xvzf scilab-4.1.2.bin.linux-i686.tar.gz
cd /opt/scilab-4.1.2
sudo wget http://hart.sourceforge.net/scilablibs.tar.gz
sudo tar xvzf scilablibs.tar.gz
sudo make
sudo ln -s /opt/scilab-4.1.2/bin/scilab /usr/local/bin/scilab
cd /usr/local/src
sudo svn co https://qrtailab.svn.sourceforge.net/svnroot/qrtailab/trunk qrtailab
cd /usr/local/srcIf you use a tar.gz-version please replace qrtailab with qrtailab-x.x.x (x.x.x is the number of your installed version )
sudo wget http://downloads.sourceforge.net/qrtailab/QRtaiLab-0.1.12.tar.gz
sudo tar xvzf QRtaiLab-0.1.12.tar.gz
cd /usr/local/src/qrtailabEdit qrtailab.config and replace '/usr/include/qwt/' with '/usr/include/qwt-qt4/' and '-lqwt' with '-lqwt-qt4'
sudo qmake-qt4
sudo make
sudo make install
svn co https://hart.svn.sourceforge.net/svnroot/hart/trunk hart
wget http://dfn.dl.sourceforge.net/sourceforge/hart/hart_0.4.1-src.tar.gzGo in your hart-directory.
tar xvzf hart_0.4.1-src.tar.gz
makeGratulation you are finished!
cd /..../scilab-xxx/contrib
sudo ln -s {link to hart-toolbox} .