help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ADC


From: Andrey Romanenko
Subject: Re: ADC
Date: Thu, 9 Jun 2005 22:51:17 +0100
User-agent: KMail/1.7.2

Hi!

On Thursday 09 June 2005 22:10, Stefan van der Walt wrote:
> Hi Ricardo
>
> On Thu, Jun 09, 2005 at 03:27:38PM -0300, Ricardo Ramiro Peña wrote:
> > How data are acquired with a conversor (Analogical-Digital) with Octave?
> > I wrote a program in C generating a file with the data. And later I open
> > them Octave .
> > Does form exist but easy to make it directly with Octave?
>
> It sounds like you already have the C code to read data from your A/D
> converter.  This code can very easily be wrapped in a C++ oct-file for
> use inside Octave.

Alternatively, if the only reason for accessing DAQ stuff directly is the need 
to have the data online, you can still keep your setup, but instead of 
blowing the data from the other program into a regular file, pipe it through  
octave's stdin:

echo "2.0"|octave mmm.m
4
----
where mmm.m:
a=fscanf(stdin, "%lf");
a**2
 
You can add error handling according to your taste.

If you don't like stdin, you can create a named pipe (mkfifo) and do the data 
transfer  using that.

Anyway, as Stefan pointed out, there should be no big problem making a 
C++octave wrapper, now that you already have the driver part written.

Andrey



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]