Thread Subject: synchronizing posttrigger DAQ with two boards

Subject: synchronizing posttrigger DAQ with two boards

From: S.J.

Date: 26 Feb, 2009 18:47:02

Message: 1 of 4

The new upgrades to 2008b for synchronizing two NI boards are *great*. Thanks!
While I've got the two boards synchronized from a start(ai) point, now I've got the challenge of stopping them with a synchronized posttrigger, specifically a posttrigger that I cannot predict in advance (i.e., we trigger after an unpredictable event). Is this possible? I originally thought that running the trigger on the master board would automatically stop the slave board, but it doesn't seem to work that way.
Any ideas?
Thanks!

Subject: synchronizing posttrigger DAQ with two boards

From: Sherryl Radbil

Date: 27 Feb, 2009 03:56:01

Message: 2 of 4

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

Subject: synchronizing posttrigger DAQ with two boards

From: S.J.

Date: 2 Mar, 2009 18:39:01

Message: 3 of 4

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

Subject: synchronizing posttrigger DAQ with two boards

From: Gautam Vallabha

Date: 11 May, 2009 14:20:02

Message: 4 of 4


The basic issue is how to get pretrigger data when you have synchronized input channels. This can be done in software only (i.e., without depending on specific hardware triggering capabilities) as follows:
1) Continuously get data from both channels,
2) Store the data in a circular buffer
3) when the trigger occurs (this can be a user-initiated event such as a button press), log the pretrigger data from the circular buffer.

This FileExchange entry demonstrates this procedure in more detail:
  http://www.mathworks.com/matlabcentral/fileexchange/24027

Gautam

"S.J." <oceansounds7@gmail.com> wrote in message <goh945$lpa$1@fred.mathworks.com>...
> 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

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
pretrigger Gautam Vallabha 1 May, 2009 16:01:01
triggering Gautam Vallabha 1 May, 2009 16:01:01
callback S.J. 2 Mar, 2009 13:30:08
national instru... Sherryl Radbil 27 Feb, 2009 07:36:59
daq Sherryl Radbil 27 Feb, 2009 07:36:55
callback Sherryl Radbil 27 Feb, 2009 07:36:48
rtsi Sherryl Radbil 27 Feb, 2009 07:36:32
national instru... S.J. 26 Feb, 2009 13:50:04
synchronization S.J. 26 Feb, 2009 13:50:04
daq S.J. 26 Feb, 2009 13:50:04
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com