Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the internal sample clock externally with export signal VI?

Hi folks,

 

Recently I have been trying to use Export Signal VI to access the onboard sample clock externally. I used NI 9215 to do analog input and route to PFI 7 of NI 9401 to output digital signal of sample clock. Please see the attachment for "Acq&Graph Voltage-Int Clk test.vi". But when I tried to use the PFI 7, it turned out that there was no frquency output (from reading of scope). What bothered me also was that there was no voltage output, either (suppose it should be 5 volts). What is the problem? Could you help take a look? Thanks!

 

Gary

0 Kudos
Message 1 of 4
(3,929 Views)

Hi Gary,

 

This VI exports the start trigger, not the sample clock. As written, the VI should output a single pulse on /Dev1/PFI7 when DAQmx Start Task.vi is called. I think the pulse width is around 50ns or 60ns, so if you don't configure your scope to trigger correctly, you'll miss it. You also may need to reduce the amount of time that is displayed on the scope.

 

Change the "Start Trigger" ring constant to "Sample Clock" and I think the VI should do what you want. Note that the sample clock also has a narrow pulse width, but it is periodic.

 

If that still doesn't work, could you post more information about your setup? Which model of cDAQ chassis are you using? Which slots are the NI 9401 and NI 9215 in? Which pins on the NI 9401's connector do you have connected to your scope? And what voltage are you reading on the scope? If you have a cDAQ-9178 or cDAQ-9188, what do you see when you try exporting the sample clock to one of the chassis PFIs?

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 2 of 4
(3,898 Views)

Hi Brad,

 

Thanks for your reply. I agree with you on the difference between trigger output and sample clock output, and I understood that.  Since this is a typical example from labview, I directly attched it without any change. Before I posted the question, I also had tried the sample clock (with finite or continuous samples) and I saw the same thing. Voltage reading was zero.

 

I used slot 5 and 1 for NI 9401 and NI 9215, respectively on chassis NI 9172. As I mentiond, the terminal for 9401 is PFI 7, and for voltage detect, the pin number is 25 (with COM of 12 or any of other COM). I also do agree with you about the very narrow pulse width of sample clock output. But do you think still I was supposed to have voltage readings? For example, if I directy generate the pulse train through ctr2 PFI 7 of NI 9401 simply using Measurement & Automation (test panel), I do see the voltage reading of around 2.5 v. But why it won't work for AI sample clock output (should they using the same onboard timebase?).

 

Best regards,

Gary

0 Kudos
Message 3 of 4
(3,880 Views)

Hi Gary,

 

The NI 9401 should output 0 V or 5 V, not 2.5 V. When you use a counter/timer to output a pulse train, you should see transitions between 0 V and 5 V on your scope. Do you have any other circuitry connected? If not, it sounds like one of the following things: a problem with the connections between the NI 9401 and the scope, a problem with the scope settings, or a broken or defective NI 9401.

 

I tried out your VI (with the export enum changed to "Sample Clock", of course) and it worked. Setup: DAQmx 9.2, a cDAQ-9172, a NI 9205 (I didn't have a NI 9215) in slot 1, and a NI 9401 in slot 5. I connected an oscilloscope to the NI 9401's pins 25 and 12, with the scope's probe attenuation set to 10x and volts/div set to 2 V. With the scope's seconds/div setting at 25 ns, I was able to clearly see the sample clock pulse, which turned out to be about 30 ns wide (not 50 ns or 60 ns as I thought). With the scope's seconds/div setting at 250 us, I was able to see multiple pulses and measure their frequency, but only when using the scope's "peak detect" acquisition setting was enabled (not "sample" or "average").

 

Could you try validating the output voltage with the NI 9401's "Digital I/O" test panel? Outputting a digital 0 should result in an output of 0 V. Outputting a digital 1 should result in an output of 5 V. Tristating the digital line should result in an output of 0 V due to the NI 9401's pull-down resistors, assuming that there is no external circuitry driving or pulling the digital line. If you get voltage readings that are significantly different from this, there is a problem. (The max/min logic levels are in the NI 9401 specifications.)

 

As for your question about the chassis timebases, the counter/timer timebases (80 MHz, 20 MHz, and 100 kHz) and the AI timebases (20 MHz and 100 kHz) are both derived from the same 80 MHz oscillator.

 

Brad

 

 

---
Brad Keryan
NI R&D
0 Kudos
Message 4 of 4
(3,860 Views)