Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to run analog input and analog output at the same time

Subject: How to run analog input and analog output at the same time

From: Stephane Carlier

Date: 5 Jul, 2011 18:54:09

Message: 1 of 5

I have an MCC USB-2527 DAQ board that I wish to use the onboard analog input and analog output at the same time. My applications requires for every trigger signal, the analog output channel outputs a waveform to a laser diode, and the analog input channel should synchronously record the waveform received from an optical detector. i.e, I need to run analog input and analog output simultaneously.

I found the getdata() and putdata() associated with an ai or ao objects are both block the the command lines, i.e., it's impossible to run two commands at the same time. How can I get around this problem?

Subject: How to run analog input and analog output at the same time

From: Rob Purser

Date: 5 Jul, 2011 20:08:09

Message: 2 of 5

Hi,

You're not using RTSI, but this demo should help to explain how to do simultaneous analog input and output. I'd recommend using a digital output pin on the card to trigger the analog input and output subsystems simultaneously.

http://www.mathworks.com/products/daq/demos.html?file=/products/demos/shipping/daq/demosync_ai_and_ao.html

All the best,
-Rob Purser

Subject: How to run analog input and analog output at the same time

From: Sean de

Date: 5 Jul, 2011 20:33:07

Message: 3 of 5

"Stephane Carlier" <youfellow@hotmail.com> wrote in message <iuvmkh$dvb$1@newscl01ah.mathworks.com>...
> I have an MCC USB-2527 DAQ board that I wish to use the onboard analog input and analog output at the same time. My applications requires for every trigger signal, the analog output channel outputs a waveform to a laser diode, and the analog input channel should synchronously record the waveform received from an optical detector. i.e, I need to run analog input and analog output simultaneously.
>
> I found the getdata() and putdata() associated with an ai or ao objects are both block the the command lines, i.e., it's impossible to run two commands at the same time. How can I get around this problem?

timer functions.

doc timer

Subject: How to run analog input and analog output at the same time

From: Stephane Carlier

Date: 6 Jul, 2011 11:46:10

Message: 4 of 5

Thanks. I tried the manual trigger method. It somewhat worked, but the latency was quite big.

My board is Measurement and computing, not National Instruments. I guess I am out of luck with the RTSI.

"Rob Purser" <rob.purser@mathworks.com> wrote in message <iuvqv9$qnp$1@newscl01ah.mathworks.com>...
> Hi,
>
> You're not using RTSI, but this demo should help to explain how to do simultaneous analog input and output. I'd recommend using a digital output pin on the card to trigger the analog input and output subsystems simultaneously.
>
> http://www.mathworks.com/products/daq/demos.html?file=/products/demos/shipping/daq/demosync_ai_and_ao.html
>
> All the best,
> -Rob Purser

Subject: How to run analog input and analog output at the same time

From: Rob Purser

Date: 6 Jul, 2011 12:50:25

Message: 5 of 5

Wire the trigger pins for the analog input and output subsystems to one of the digital I/O pins, set them both to use hardware triggering, and then flip the bit on on the digital I/O pin -- that'll give you a very low latency solution. The configurations a little different from the NI example, but basically, it's the same idea.

-Rob

Tags for this Thread

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.

Contact us