Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Gated data acquisition question...

Hi all,
 
I'm writing an application which includes some data acquisition. Basically, I'm tuning a tuneable laser through its wavelength range and measuring the output on a photodiode connected to a USB6212 DAQ device. The laser provides a digital output signal which is low when the laser is locked to a wavelength and high when tuning. I want to use that digital signal to do some kind of "gated" data acquisition so that I only acquire the photodiode data when the laser is locked. In addition, I want to average the acquired data over each "gate" period... i.e. acquire data at a high rate so that I have multiple data points when the gate is low, and then average that data to produce one value for each time the gate signal is low...
 
My main problem is that I've never done this kind of "gated" data acquistion before (until recently, I was using a DAQ card with 4 truely simultaneously sampled channels and simply acquiring the gate signal at the same time as the photodiode data and post processing in software...). Could anyone point me in the right direction, perhaps an example code? Also, I'm not clear exactly how to set up the DAQ card to do this...
 
Any help would be very gratefully recieved!
 
Kind regards
 
Paul Morris
0 Kudos
Message 1 of 13
(4,556 Views)

Hi Paul,

That sounds like quite an interesting application, if your interested in learning how gating works the LabVIEW help and Trigger/Gate Express VI and standard VI's have quite a bit of help information included with them. The overall architecture will require the logic to allow your program to do this on the fly and also to average out the information you require. At the moment are you using express VI's (blue border VI's) or Standard VI's to setup and use your DAQmx system?

All the best,

Applications Engineer
0 Kudos
Message 2 of 13
(4,525 Views)
Hi, Thanks for the response.

I use the DAQmx VIs to control the daq mostly. I'm fairly comfortable with standard acquisiton but just wasn't entirely sure where to start with the gated "stuff" (excuse my use of technical language!). There seems to be a large number of examples in the NI example finder, but its not always easy to find the most relevant.

I was also most concerned about the whole averaging thing, as I can see how simple gating would work (i.e. only acquiring when the digital signal is low), but I didn't know what that would return in terms of being able to identify the individual blocks of data from each "open-gate".

One other important point I forgot to mention in the original posting. The laser (obviously) has a finite set of channels, is it possible to "program" the DAQ device to only acquire for a set number of "counts" on the digital channel? For example, if I know there're 90 channels, can I get the daq card to run the acquisition and return the data at the end of the 90th time the digital signal is low?

Thanks again for your response. I'll have a look into the examples, but it wont be untill tomorrow as I have a small issue with a dead DAQ board!

Paul
0 Kudos
Message 3 of 13
(4,521 Views)

Hi Paul,

I understand exactly the issues with the examples and morphing them to your application needs, although they can be useful for understanding the core of how something works. Do you have a datasheet on the laser your using at all and how your measuring this to the DAQ card? If you want to read through when the logic is low for 90 times only then this is something you'd have to include into your program architecture.

Let me know if I've mis-understood anything here,

All the best,

Applications Engineer
0 Kudos
Message 4 of 13
(4,517 Views)
I guess what I'm asking in that second bit, is whether I can "program" the DAQ card to acquire data for 90 cycles of a digital square wave or wheter I'd have to do it by continually reading the data back off the card and separately counting the cycles in software and then instruct the card to stop the acquisition when my count reaches 90?


I'll have a play with the hardware tomorrow anyways and post back when I get stuck!

Thanks for your help!

Paul



0 Kudos
Message 5 of 13
(4,512 Views)

Hi Paul,

You should be able to acquire for N Samples instead of continuously i.e. tell it how many samples to read in. Although this won't care if your logic is low or high, it will simple read 90 times. Ok smashing, let me know if any issues come up tomorrow! (hopefully all will go well)

All the best,

Applications Engineer
0 Kudos
Message 6 of 13
(4,510 Views)
Right, I've set things up as follows:
 
The digital output from the laser (which is high when its locked and thus when I can make a measurement on the Analogue input of the DAQ card) is connected to PFI0 on a USB6211 DAQ card.
Photodiode output is connected to AI0 on the same DAQ card.
 
I've been able to write some code which counts the number of times the laser signal is high and uses that to stop the acquisition after the right number. I have also been able to use the digital signal to "trigger" the AI acquisition so that I get one sample each time the trigger switches low to high. However, I know that the AI sampling rate is high enough that I should be able to obtain multiple samples whilst the digital signal is high. But I have been unable to use the digital signal to "gate" the analogue input and obtain these multiple samples. For clarity, I've drawn out what I want to do in the file schema.png attached. My current labview code for the acquisition can be seen in attempt_1.vi (labview 8.0) although you will not be able to run it as it requires the laser to generate the actual signals!
 
Any help would be greatly appreciated!
 
Thanks
Paul
Download All
0 Kudos
Message 7 of 13
(4,480 Views)

Hi Paul,

Apologies for the late reply, I believe you need some digital pulse triggering inside your code in order to allow the AI to read multiple samples, but this is something I'm working on verifying with a device and I will look at tomorrow. The rest of the program looks good through, certainly sounds like an interesting application to build!

I'll let you know what I find tomorrow,

All the best,

Applications Engineer
0 Kudos
Message 8 of 13
(4,469 Views)
I did make some more progress after my last message. I managed to use a "pause trigger" (from the trigger property node) to essentially pause the AI daq when the digital output of the laser is low. So in this case, I acquire all of the data samples in the figure I posted abover which occur when the digital signal is high. BUT (and there had to be one!) in this method, I have no way of identifying the different groups of data since the acquisition simply gives me an array with all of the data in one long line! So I still can't average the data down to what I'm aiming for! What I need for this method to work would be some kind of marker within the data to show when the acquisition task was paused by the trigger signal!

I don't have the code to hand right now to show  you this modification, but I can post it in the morning...

Thanks for your continued help with this!

Paul
0 Kudos
Message 9 of 13
(4,465 Views)

Just been browsing through the developper zone and found the attached example vi. It sounds from the description like it might do what I want but its written in labview 8.2 and I'm on 8.0... anyone convert it down for me?!

thanks!

http://zone.ni.com/devzone/cda/epd/p/id/5579#0requirements

0 Kudos
Message 10 of 13
(4,449 Views)