Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: synchronizing posttrigger DAQ with two boards
Date: Mon, 2 Mar 2009 18:39:01 +0000 (UTC)
Organization: University of California Berkeley
Lines: 29
Message-ID: <goh945$lpa$1@fred.mathworks.com>
References: <go6o36$c5f$1@fred.mathworks.com> <go7o8h$2r1$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1236019141 22314 172.30.248.35 (2 Mar 2009 18:39:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 2 Mar 2009 18:39:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 94343
Xref: news.mathworks.com comp.soft-sys.matlab:521949


Hi Sherryl,

Thanks for the excellent suggestions.  I've played around with the StopFcn, TriggerFcn, etc., but I'm not seeing how this would yield a simultaneous trigger.  Perhaps I'm not thinking about this correctly?  Here is my thought process:

I think a TriggerFcn is more appropriate than a StopFcn, because I still need to run getdata to pull the data into the workspace from both daq devices.

Thus, I set the main device TriggerFcn to run a callback that triggers the secondary device.  

But....it still takes time to run the TriggerFcn callback and then trigger the secondary device.  As far I can tell this would yield the same delay as just typing "trigger(maindevice)" and then "trigger(secondarydevice)" in the body of the program.

I'll try some other ideas in the meantime..

Thanks!


"Sherryl Radbil" <sherryl.radbil.dontspamme@mathworks.com> wrote in message <go7o8h$2r1$1@fred.mathworks.com>...
> Hi S.J.,
> Glad you like the support for RTSI that was made available in R2008b.
> Others reading this thread can find out more at
> http://www.mathworks.com/access/helpdesk/help/toolbox/daq/rn/brw8x4l-1.html#brqy2tk-3
> http://www.mathworks.com/access/helpdesk/help/toolbox/daq/brt7oe_-1.html
> and the shipped file: demosync_ai_and_ao.m
> 
> Regarding how to have one device stop another, consider using the StopFcn callback
> http://www.mathworks.com/access/helpdesk/help/toolbox/daq/stopfcn.html
> 
> Set the StopFcn for the main device and in the callback itself call stop on the secondary device. You could use the main device's UserData property to store the handle to the secondary device.
> 
> Sherryl