Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Continuous Sampling and Digital Triggering

Hi,
 
I have am trying to sample the AO channels of my USB-6009 device with my computer like an oscilloscope. I've written the following program, I was wondering weither I could take the configure VI and Clear Task VI outside the while loop to reduce CPU usage. Because right now i run everything inside the same while loop and it seems like a waste.
 
I have tried to take out parts of the VI outside the loop but LabVIEW always return me with an error, if anyone could give me a hand much will be appreciated
 
- David
0 Kudos
Message 1 of 10
(4,482 Views)
Hi!

   Can you post the example for LabVIEW 7? You can save your project to be compatible with older version, then much people will be able to help you (...I hope!).

graziano
0 Kudos
Message 2 of 10
(4,476 Views)
Hi David,

I hope you're doing well.  You have the right idea that having the configuration and clearing VIs inside your loop is inefficient, since you normally only need to do this once.  However, one thing I should point out is that if you want to acquire data continuously with a start trigger, there is a shipping example written in LabVIEW for this.  You can find this in LabVIEW by going to Help»Find Examples, then Hardware Input and Output»DAQmx»Analog Measurements»Voltage»Cont Acq&Graph Voltage-Ext Clk-Dig Start.vi .  This actually uses an external clock, but you can simply use the internal clock by deleting Clock Source control that is wired into the "source" terminal on the DAQmx Timing.vi.  To point out some of the differences between your VI and the one I've suggested: 1.) the Sample Mode on the DAQmx Timing.vi is set to Continuous Samples rather than Finite Samples, 2.) The sample clock is set up with the DAQmx Timing.vi is set up prior to setting up the triggering (this may or may not matter, but it may be something you can try fixing if changing the sample mode doesn't help).  Let us know if this helps!

Thaison V
Applications Engineer
National Instruments

0 Kudos
Message 3 of 10
(4,461 Views)
Hi,
 
Thanks for your help, much appreciated.
 
The problem with using continuous sampling is that the trigger is lost. I can no longer display let's say a square wave at the same position of the graph everytime. I guess the idea with digital start is that once it sees the first edge the aquisition starts and just keep displaying. I don't need to keep track of every moment since the signals sampled is periodic. What I need is to display same parts of that signal on every acquisition.
 
Thank You
 
 
0 Kudos
Message 4 of 10
(4,455 Views)
Hi graziano,
 
Thanks for replying, I have converted the VIs into version 7.1, it was originally an example with some modification.
 
Thank You
 
- David 
0 Kudos
Message 5 of 10
(4,454 Views)
Hi David!

   In general, for DAQmx, you can't start twice the same task! I mean, if you leave inside the while loop the "start task" vi and the "read" vi, you'll get errors.  Otherwise, it should work if you leave, inside the while loop, the only "read" vi, taking outside all other vis, or leaving inside the while loop the START vi, the READ vi and a STOP task vi.

   Currently I have no DAQmx board, so I can't test what I'm saying, I refer to previous practice I've done (now I'm working with FieldPoint technology).

   Anyway, if you want to build a scope, I think it's better to perform a continuous sampling, and do some software computation to simulate trigger settings of a scope (level, slope, etc...), so that your periodic signal can be shown as fixed on screen. 

   If you make the acquisition start with a certain level, you won't be able to show a still image, because sinusoid will in general begin with positive part in some cycles, and negative in others, so image will flash.

   Let me know for further news.... have a nice day!

graziano
0 Kudos
Message 6 of 10
(4,450 Views)
David,

What Graziano has mentioned is right on for DAQ hardware in addition to some FieldPoint hardware.  Software triggering may be the best way to go if you are planning on using the USB-6009 for this.  We do have scope products that are tailored for these applications, but they are a bit more costly than the USB devices.  That being said, try out the example code attached.  This was written by one of our other Applications Engineers to have scope functionality on some of our DAQ products.  Let us know if this helps!

Thaison V
Applications Engineer
National Instruments
0 Kudos
Message 7 of 10
(4,427 Views)
Hi Thaison V!
   I'm just wondering.... in DAQmx digitizers, triggering is done via software??? If so, what's the difference between a multifunction DAQ and a Digitizer? I supposed there should be some HW solutions to detect slope, period of signal, and oversampling...


   Have a nice w-e!

graziano
0 Kudos
Message 8 of 10
(4,424 Views)

Hi Graziano,

I think what Thaison meant is that digitizers are better suited for oscilloscope applications, not that their functionality is implemented in software, because it is hardware functionality.  The example that he posted performs all the necessary software calculations to have a multifunction DAQ device act like an oscilloscope.

I hope this helps!

Laura

0 Kudos
Message 9 of 10
(4,386 Views)
Hi, Laura!

  Yes, it helps, and thanks for answering a simple curiosity question!!!!!!


   Have a nice day!

graziano
0 Kudos
Message 10 of 10
(4,379 Views)