If the driver is correctly loaded, you can launch the board_info demo of
comedilib.
dsharma a écrit :
For testing your rtai-lib blocks, you have to generate the RT code of
your model (RTAICodeGen function, see the RTAI-Lab tutorial).
∂єєραк >>;) a écrit :
> thanks Guillaume for your reply,
>
> what is the command for launching board info...? And can I interface
> analog input/output.
>
> Regards
> DP
>
> On Tue, Jun 23, 2009 at 2:17 PM, Guillaume Millet <mil...@isir.fr
> <mailto:mil...@isir.fr>> wrote:
>
>
> for several months, /dev/comedi0 has been directly configured when you
> load the ni_pcimio module.
>
> If the driver is correctly loaded, you can launch the board_info
> demo of
> comedilib.
>
--
Guillaume Millet
Institut des Systèmes Intelligents et de Robotique
Université Pierre et Marie Curie - Paris 6
Tel : +33 1 44 27 63 79
Actually, you can just set the value on the command line:
./outp -v -s 1 1200
> root@deepak-desktop:/usr/local/src/comedilib/demo# gcc outp.c -lcomedi
> -o outp
> In file included from outp.c:16:
> /usr/local/include/comedilib.h:32:2: error: #error linux/comedilib.h
> should not be included by non-kernel-space code
It looks like gcc has found Comedi's comedilib.h file instead of
Comedilib's comedilib.h. There are some instructions floating around
which say to replace the comedilib.h file installed by Comedilib with
the one from Comedi, but that breaks compilation of user-space programs
using comedilib.
If you run "make" in Comedilib's demo directory, I think it will use
local copies of the comedi.h and comedilib.h files instead of the ones
in /usr/local/include.
It is possible to build RTAI without having to overwrite the comedilib.h
file by using the following RTAI ./configure option:
--with-comedi=/path/to/comedi-source (replacing with the real path to
the Comedi source). I don't think there is a way to do this in the RTAI
configuration menu yet.
> Can any body please guide me through..? Where is this structure defined
> data =options.value;
It's in the common.c file in Comedilib's demo directory. This needs to
be compiled and linked with outp.c:
gcc -O2 outp.c common.c -o outp -lcomedi -lm
(The above command assumes you haven't replaced the comedilib.h
installed by Comedilib with the one from Comedi.)
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
Now, it's not a problem from RTAI as RTAI uses
/usr/local/include/linux/comedilib.h (if comedi is installed in /usr/local).
Maybe it was not the case in the past (used
/usr/local/include/comedilib.h), so most tutorials said what Ian explained.
When you install comedi, you should just execute the following lines:
make install
mkdir -p /usr/local/include/linux
cp include/linux/comedi.h include/linux/comedilib.h /usr/local/include/linux
By the way, with last RTAI (>= 3.7.1), by default, you need to keep the
non-RT comedilib.h in /usr/local/include to compile Scicos RTAI-Lib
blocks using soft-calibration data (needed if your board is
soft-calibrated, with comedi_soft_calibrate). If you can use
comedi_calibrate, then you don't need this feature and can disable it at
the compilation in removing -DSOFTCALIB in the appropriate Makefile.
--
Guillaume Millet
I wrote these lines because they are different from that in main guides
(RTAI-Lab-tutorial and RTAI-UbuntuGutsy-Matlab.txt).
> actually I am understanding how the comedi works but my actually aim
> is to run an matlab/simulink model running on RTAI/linux/Comedi which
> is having comedi block in it(COMEDI_DATA READ & COMEDI_DATA_WRITE) and
> output some information(analog or digital) and input some information.
> I dont know whether I can use these blocks for continous data
> aquisition. Can I able to use these blocks ....how I can select the
> subdevice (like subdevice 1for analog output) in these block.( no
> option in it)....any simple application...
> thanks
> DP
>
Yes you can. I don't use simulink, but I think that there should be a
dialog box when open the block in simulink, no ?
For problems about RTAI-lib blocks, you should post on the RTAI mailing
list.
--
Guillaume Millet