Jump to content

Waveform output with sample clock


horatius

Recommended Posts

I continuously output analog voltage values with a DAQ card. To obtain fast and a reliable homogeneous sampling I use the sample clock of the board and a LV waveform signal. In the waveform for each time step of the sample time the output voltage value is saved.

As seen in the block diagram I can select whether the waveform content is outputted only once ("finite samples") or repetitiously ("continuous samples"). However I want to repeat it only for a defined number, let's say 100 times. I have two options:

To do this I can:

A) 100 times replicate the length of the waveform itself ---> insufficient memory

or

B) output waveform only once and repeat this procedure 100 times --> no smooth signal transmission as the device reinitializes every time

No options works well as I need a homogeneous output without interrupting device initialization procedures and I have to avoid too long waveforms.

post-11132-1228412555.png?width=400

Link to comment

Move the DAQMx Write into the loop and then execute the loop as many times as required to recreate the complete waveform as many times as you want. If you start the task outside the loop, the device shouldn't reinitialize on every iteration (see the Start Task topic here http://zone.ni.com/devzone/cda/tut/p/id/2835#toc5). Stop the task outside the loop, and then clear. It may appear that the device is resetting depending on the end condition of your waveforms - are they continous if called back-to-back? If you've already tried this and it didn't work, to quote Emily Latella ( http://en.wikipedia.org/wiki/Emily_Litella ) "Never Mind" :rolleyes: I don't actually have any hardware handy to try this so take this FWIW.

Mark

Link to comment

I tested loops. I inserted DAQWrite and DAQStart in the while loop. Then I left it outside and constructed a for loop around DAQWriet/Start and While loop. I tested "Continuous sample" and "finite sample" mode. Nothing worked as I need.

If I use "Finite Sample" then I get an error that I exceed the number of samples if I start the task again.

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.