Mbuff is nice and fancy.

FIFOs are better for what you want.  I like to reserve mbuffs for really
complicated state information rather than using it as a simple data fifo.
Also, in order to get the mbuff to work 100% correctly for data
acquisition, you basically have to write a fifo to put into it, which is
like re-inventing the wheel.  You might as well use the /dev/rtf* device
nodes for this task.  That's what David Christini and I did for our DAQ
System software (http://www.rtlab.org).  We basically set aside one fifo
device file: /dev/rtf0 (I think) and kept writing an array of samples into
it (the array was the size of our number of input channels).  There was a
mechanism whereby the Qt app was kept informed od the sampling rate, so
basically all it needed to do was suck the samples out of the FIFO.  It
didn't really care about the sampling rate, it knew data would be
magically ready for it now and then.

All the Qt app really needed the sampling rate information for was so that
it could visualize the data on the screen with respect to actual wall
clock time.

The advantage of using these device files is that (1): you can use the
select/poll system calls on them, rather than some scheme with shared
memory to emulate this (2): they are generic enough so that your
application can be written without knowing ANYTHING about real-time linux.
Verily, you can easily use your application to sample any kind of data,
whether it uses real-time-linux or not.

if you want me to be more specific, I can prodive you with core code
samples..

-Calin

On Wed, 15 Aug 2001, Olivier Forget wrote:

> Hi,
>
> I am writing a data acquisition and display program, so I need to "send"
> several floats from the RTLinux thread (where the data is acquired) to the
> linux/Qt program for display. There will probably be up to 16 floats being
> sent at a rate of probably 200Hz, possibly up to 1000Hz.
>
> rtf-put only accepts characters, so it desn't seem to be ideal.
>
> mbuff looks interesting but I have found the doc to be sparse.
>
> I am sure that many of you have had to do this, so I would like to hear your
> opinions. Code snippets would be appreciated to help me along.
>
> Thank-you!
>
> Oliver
> National Test Pilot School
>
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/
>
>

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to