05-27-2009 09:53 PM
Hi,
I am using a PCI-6251 M series DAQ card and I want a 1 MS/s sampling rate for a maximum of 100 samples (a few pre-trigger samples too possibly) by triggering on PFI0 and still be able to capture the next trigger that occurs about 1 ms later. Basically I have a 20 us signal and a 1 kHz rep rate (though can be as high a 4 kHz). I have tried the Cont Acq&Graph-Int Clk example in the NI examples for the card in DAQmx, but 2 problems exist: one, you do not seem to be able to grab pre-trigger shots when you use Continuous Samples on the Sample clock; and two, even when I loop Start DAQ -> Read 1 Channel N Samples -> Stop DAQ, I max out at 200 Hz...(I varied the rep rate of the signal until the loop frequency saturated).
I have used a retrigger.vi for LabVIEW 6 on an E-series card that basically set one internal counter going as a pulse generator and then a second counter was triggered at the same rate off of PFI0 as a gating signal and sent to the AI input GPCTR clock (or some such...was a bit of black art to me). That seemed to allow me to get nearly 4 kHz rep rates for that card (since they only other way was a s/w trigger that consumed too much time).
Now, for this experiment I can "cheat" by knowing how many samples I need and simply triggering once and then collecting the whole lot of data over a few seconds, but I am curious to know if there is a way of getting a few tens of samples (with pre-trigger points) at a 1 MS/s or higher sampling rate with a 1 -10 kHz triggering rep rate.
Thanks for your time,
Sean
05-28-2009 05:18 PM
Sean,
It sounds like you are trying to do a "retrigerable Reference Trigger" for your analog voltage task. It is important to note that Reference triggers are NOT retrigerable. The only retriggerable triggers are counter Start Triggers.
Please see the following NI.com/community Example program that uses Retrigerable Finite Acquisition. : http://decibel.ni.com/content/docs/DOC-4131 This VI will allow you to wire in a trigger signal (can be 1kHz if you want) Specify it as your Trigger input. This will be used to trigger a finite pulse train on the counter of your device. This pfinite pulse train is then used as the sample clock for the analog input acquisition. You can specify that sampling clock rate to be 1MHz. Unfortunately, at this time I don't think you'll be able to get pre-trigger samples with this particular program because it does NOT use reference triggers. I suggest trying out this particular example and seeing if you can make this work for your application.
If you have problems or questions feel free to re-post here!
Thank you
06-11-2009 09:09 AM
Hi Charles,
Thanks for the reply, I gave it a try and had some issues with it (unfortunately I didn't log them for discussion here since the application changed faster than I had time to document the issue).
Now, I am looking to generate a pulse out of AO and read in from a couple of AI, all triggered by PFI0. I would like to delay the AO from the PFI0 trigger by a few microseconds. I am struggling to understand the wiring of a counter to the sample clocks, as I think this setup requires. Ideally, PFI0 gets a digital edge at 0.5 - 1 kHz, then AO would generate a low-high-low pulse of 1 ms to 1 s duration about 1 - 10 microseconds after PFI0 (I want the delay to be variable), but I want AI0 and AI1 to measure the input at a 1MS/s/ch sampling rate.
I have LV 8.2 and a NI-PCI-6251M with a BNC-2090 breakout box.
Cheers,
Sean
06-12-2009 10:12 AM
First Off, you will not be able to read more than one channel at 1MS/s/Ch. Your PCI 6251 is capable of reading 1 channel at 1.25MS/s. However when you have more than one channel the PCI-6251 must scan between channels and the maximum transfer rate is 1.0MS/s Aggreagate. This Means that if you are to read from two channels would be able to read each channel at 500kS/s/ch.
There is no need to wire the counterout to any thing. You are creating the sample clock on CTR 0 out which corresponds to PFI12 (from the device pinout) . Therefore all you need to do is specify PFI12 as your sample clock source for both your AI and AO tasks.
FOr Your AO I've prgrammed it in in the attached VI, in this case you have provide an array of data that will be updated at the same rate as your AI task (Counter sample clock). However if you are trying to do Digital logic output (5V high of 1ms and then low etc... You may want to do another counter output where you can specify deterministically the time of high and low and how many samples you directly want. This would be outputed on Counter 1 OUT. And you can programatically change the delay and high/low time using a property node. Please see the attached VI.