DAQ/Basic/Installation/English
Title of script: Configuration of PC/Laptop to use DAQ with Scilab
Author: Rakhi R
Keywords: Data Acquisition, Scilab, HART, COMEDI, Installation
|
|
Show Slide 1 | Hello and welcome to the Spoken Tutorial on Configuration of PC/Laptop to use DAQ with Scilab. |
Show Slide 2 | The objectives of this tutorial are:
|
Point 2 in Slide 2 | Configuration of these packages, and |
Point 3 in Slide 2 | Checking and verifying your installation |
Show Slide 3 | The pre-requisites for this tutorial are:
|
Point 2 in Slide 3 | Basic knowledge of shell commands in Linux |
Show Slide 4 | For this tutorial, I have used the DAQ hardware, USBDUXFAST.
|
Point 2 in Slide 4 | Operating System used is Ubuntu 10.04 |
Show Slide 5 | The software used in this tutorial are:
COMEDI suite |
Point 2 in Slide 5 | Scilab 5.3.1 |
Point 3 in Slide 5 | HART Toolbox version 0.4.4 in Scilab
|
Show Slide 6 | Let us first check the version of the kernel that I am running. |
Open Linux terminal window and
type: uname -r |
Type this |
Show the terminal screen with the output of uname -r | My kernel version is 2.6.32-24. |
Point 2 in Slide 6 | If your kernel version is older than 2.6.30, you have to manually install the COMEDI suite in your PC. |
Point 3 in Slide 6 | For this, please watch the Spoken tutorial on Manual Installation of COMEDI suite.
|
Point 4 in Slide 6 | Lets continue this tutorial assuming that your kernel version is 2.6.30 or higher.
|
Open terminal and type:
|
Install them using this command.
I have already installed these. |
Open the terminal and type:
|
You can validate comedi installation by checking the staging folder for COMEDI modules.
the path will be lib-modules-your kernel version-kernel-drivers etc. |
Show Slide 7 | The next step is to install HART toolbox. |
Point 2 in Slide 7 | I assume that you have installed Scilab 5.3.1 in your PC.
|
Point 3 in Slide 7 | Install the packages gcc and g++ if they are not installed in your PC. |
Open terminal and type:
|
Gcc and g++ can be installed by this command. |
Open firefox and go to the URL:
http://hart.sourceforge.net/downloads.html
|
Download the latest version of HART toolbox.
I have already downloaded this.
|
Show the location of Scilab-5.3.1 folder | Save the unpacked folder in the contrib directory of Scilab.
I have already done this. |
Open the terminal and type:
|
I go to this folder now. |
Type the following on terminal:
sudo gedit Makefile |
You may need to make some changes in the Makefile of the HART toolbox, if you have your scilab installation in say, /home/xxx folder. |
Type the following in the makefile:
SCILAB_DIR = /home/rakhi/Mystuff/scilab-$(SCILAB_VERSION) SCILAB = $(SCILAB_DIR)/bin/scilab
#SCILAB = scicoslab |
Modify the makefile
Uncomment the first three lines as shown (by deleting the hash symbol at the beginning of the line)
Note that you will have to write the path to your Scilab-5.3.x folder in the field SCILAB_DIR.
|
Close and save the makefile.
|
Do a make.
Please check the terminal for any errors. Ensure that you do not get any errors while doing the make. If you get any error, please troubleshoot and recompile until no errors are present on compilation. Troubleshooting includes installing any missing libraries or packages. |
Now you have installed HART toolbox.
As we do not use the hard real time component of HART, let us do the following to remove the RTAI related components from HART. Go to ~/scilab-5.3.x/share/scilab/contrib/hart_0.4.4/etc folder Modify the HART.start file in this folder( you need to do this in sudo mode, i.e., as a super user). Comment out the following lines (by adding // to the left of the lines as given below): // xcosPalAdd(pathmacros+'/palettes/hart_base/hart_base.xpal','Hart'); // xcosPalAdd(pathmacros+'/palettes/rtpreempt/rtpreempt.xpal','Hart'); Instead of the line containing rtprempt.xpal, you will have to comment out: //xcosPalAdd(pathmacros+'/palettes/RTAI/RTAI.xpal','Hart'); in certain versions of HART
| |
Open Scilab-5.3.1
|
This toolbox can be loaded in Scilab now and let us find out what are the options in the toolbox.
|
Note that you need to get the same messages as these in the Scilab console.
| |
On the Scilab window, type:
|
If there is no option named Toolbox on the Scilab window (this could happen if you use say Scilab 5.3.2), change your directory.
|
Open Xcos.
Click on Hart from the Pallette browser. Click on Comedi |
Let us open xcos and check the COMEDI blocks available in the Hart COMEDI palette. |
So the HART toolbox installation is now validated. | |
Show Slide 8 | Now let us check this installation by using a DAQ card. |
Point 2 in Slide 8 | I am using USB DUX FAST, which is a USB based DAQ card. |
Open terminal and type the following:
|
Users with kernel versions older than 2.6.30, need to load the COMEDI modules corresponding to the DAQ hardware used. |
Open firefox and type:
|
You can find the name of the module to be loaded from the COMEDI website.
|
Plug in USBDUX FAST. |
Type the following in the terminal to ensure that all users have the privilege to read and write into COMEDI devices. This needs to be done as a super user: chmod a+rw /dev/comedi* This needs to be done each time you restart your computer. You can also ask the OS to do this automatically after each reboot, if you wish to do so. Plug in USBDUXFAST now. |
Type the follwing in terminal:
|
Type dmesg pipe grep comedi on the terminal
You can see that USBDUXFAST is recognised as a COMEDI device.
|
Show Slide 9 | So in this tutorial, we have learnt how to install the required packages |
Point 2 in Slide 9 | And how to verify the installation for using DAQ with Scilab |
Show Slide 10 | Spoken tutorial is a part of Talk to a Teacher project.
|
Point 2 in Slide 10 | This is supported by National Mission on Education
through ICT, MHRD, Govt of India. |
Point 3 in Slide 10 | More information on this mission is available at : |
Hope you found this tutorial useful.
|