start/stop data acquisition via gui

start/stop data acquisition via gui

Post by Heather Ku » Thu, 23 Feb 2006 05:49:05


hello.

i have a gui set up that records a mic signal using start(AI).
currently, the program is set up so it will record for a specific
number of samples.

what i'd really like is to be able to control start and stop of data
acquisition with the push of a button on the gui. this way my
recordings will be of variable length.

however, i haven't figured out a way to have matlab read the button
info and get that info to stop recording. what happens is matlab
records all the sample it is looking for, and then i can send info
from the gui.

i'd greatly appreciate any tips or tricks.
 
 
 

start/stop data acquisition via gui

Post by Matthew Cr » Thu, 23 Feb 2006 07:18:15


Hello,

I think it dependes on the card you are using. Most low-cost data
acquisition hardware is unable to do what you are describing.

However, I imagine if your Sampling Rate is low enough you might be able
"sort-of" do it by running data acquisition in bursts. Between bursts
you could check for a the signal to stop.

Don't know of a better way, but it certainly may exist.

-Matt

 
 
 

start/stop data acquisition via gui

Post by Rob Purse » Thu, 23 Feb 2006 07:31:54

How about Scott Hirsch's Start/Stop button?

http://www.yqcomputer.com/
 
 
 

start/stop data acquisition via gui

Post by Rob Purse » Thu, 23 Feb 2006 07:33:13

How about Scott Hirsch's Start/Stop button?

http://www.yqcomputer.com/

You can set up an acquisition to acquire Inf SamplesPerTrigger, and then use
STOP when the button is pushed.

-Rob Purser

--
Rob Purser
Data Acquisition Engineer
The MathWorks
XXXX@XXXXX.COM
 
 
 

start/stop data acquisition via gui

Post by Heather Ku » Mon, 27 Feb 2006 10:18:07

Hi Rob,

Thanks for getting back to me. I'm having some luck with the
start/stop button, but I can't get the data to save properly.

I'm only getting the first 8000 samples, which, coincidentally is the
Fs. No matter where I put the "getdata" call, I still get no
variation on data length.

Any insights?

Thanks,
~heather~


message

specific
matlab
 
 
 

start/stop data acquisition via gui

Post by Rob Purse » Tue, 07 Mar 2006 21:27:22

Hi,

Check the documentation on GETDATA.
http://www.yqcomputer.com/

data = getdata(obj) extracts the number of samples specified by the
SamplesPerTrigger property for each channel contained by obj. data is an
m-by-n array where m is the number of samples extracted and n is the number
of channels.

By default, you'll get one trigger's worth of data. You can either call
GETDATA repeatedly, or call getdata(obj,samples) to extracts the number of
samples specified by samples for each channel contained by obj. Note that
GETDATA separates triggers with a NaN.

-Rob