Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ connections for an analog TTL sample clock

Solved!
Go to solution

Hi,

I wasn't sure whether to post this here or in the software boards so apologies if this is not relevant.

 

I am doing laser experienments where I am trying to detect laser pulses with photodiodes. I am trying to set up a TTL pulse firing at 400Hz as the sample clock of our DAQ card [DAQ card model is the one on the left in this link: http://www.ni.com/datasheet/pdf/en/ds-25, we are connecting to this DAQ card using an SCB-68 connector (http://sine.ni.com/nips/cds/view/p/lang/en/nid/1180) with BNC cables wired into the analog inputs].

 

I want this sample clock to be in sync with a 200Hz trigger signal. 

 

I.e. I want the 400Hz sample clock to start in sync with a 200Hz trigger, so that every first peak of the 400Hz TTL signal simultaneously corresponds to a peak of the 200Hz trigger signal.

 

 

 

I am having a problem with the following two tasks:

1) figuring out where to connect the inputs that I want acting as the sample clock and trigger

2) figuring out how to select these inputs (within the daq assistant software) to act as a sample clock and a trigger

 

When I open up the daq assistant menu, I can select the 4 channels I have connected to BNC inputs: ai0, ai1, ai2, ai3. (refer to daq inputs.png).

I want one of these to act as a sample clock and another one to act as a trigger to set the phase of the sample clock. However, when I open up the DAQ assistant and try to select ai1 to serve as the sample clock, it does not show up in the available inputs (see sample clock inputs.png). Also, the only channel that the daq assistant lets me use as a trigger is ai0, nothing else (see available trigger inputs .png)

 

How can I select ai1 to be my sample clock and use ai0 to be my trigger? Is this possible to do? If not, where should I connect my sample clock signal into the daq card?

 

Thanks a lot in advance!

 

0 Kudos
Message 1 of 14
(5,443 Views)

Hello hexagram,

 

You got the correct forum for this question!

 

If I understand your setup correctly, it looks like the output of the digital delay generator and the chopper controller are digital signals (as the TTL logic would imply). In general, you should always use a digital input channel as your clock source and not an analog input channel. You can trigger off of an analog signal, but it might be best to trigger off a digital signal as well, if both are pulses. If you rewire your inputs to use digital lines, you should be able to select those lines in NI MAX.

 

Your SCB-68 should have the PFI lines (which are what DAQ Assistant is asking you to choose from for the sample clock) labeled on it. More information about PFI lines can be found here: PFI Lines: M Series

 

Regards,

Hannah L.

Applications Engineering 

National Instruments 

www.ni.com/support 

0 Kudos
Message 2 of 14
(5,383 Views)

Hi,

Thanks for the response!

So we have hooked up our TTL output to the line PFI13 (which, if I understand the pins correctly should correspond to 40 on the SCB-68 pin connection http://www.ni.com/datasheet/pdf/en/ds-25)

Our Trigger signal is a TTL pulse as well, so does that mean that we should also wire it to one of the PFI inputs instead of the analog inputs?

 

Thanks again!

0 Kudos
Message 3 of 14
(5,373 Views)

Hi Again,

http://www.ni.com/datasheet/pdf/en/ds-25

So we have connected The 400Hz TTL sample clock to PFI13 (pin 40, using pin 7 as the ground) and the 200Hz TTL trigger to PFI14 (pin 1, using pin 35 as the ground).

We have connected our two analog inputs into channels ai0 and ai1, using the pins shown in voltage connections .png.

Now when I go into DAQ assistant and set PF13 as a sample clock and PF14 as the trigger, we get an error saying the following

 "Error -200284 occurred at DAQ Assistant

 

Possible Reason(s):

Some or all of the samples requested have not yet been acquired.

To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock."

 

However we have confirmed using an oscilloscopy that both the trigger and sample clock BNCs are indeed carrying signals. Is there some issue with wiring that could be causing this? It seems that the daq card just isn't picking up our TTL trigger.

 

Thanks,

0 Kudos
Message 4 of 14
(5,361 Views)

Hi Again,

http://www.ni.com/datasheet/pdf/en/ds-25

So we have connected The 400Hz TTL sample clock to PFI13 (pin 40, using pin 7 as the ground) and the 200Hz TTL trigger to PFI14 (pin 1, using pin 35 as the ground).

We have connected our two analog inputs into channels ai0 and ai1, using the pins shown in voltage connections .png.

Now when I go into DAQ assistant and set PF13 as a sample clock and PF14 as the trigger, we get an error saying the following

 "Error -200284 occurred at DAQ Assistant

 

Possible Reason(s):

Some or all of the samples requested have not yet been acquired.

To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock."

 

However we have confirmed using an oscilloscopy that both the trigger and sample clock BNCs are indeed carrying signals. Is there some issue with wiring that could be causing this? It seems that the daq card just isn't picking up our TTL trigger.

 

Thanks,

Download All
0 Kudos
Message 5 of 14
(5,361 Views)

Hexagram,

 

I'm sorry that you are having so much trouble with this. We actually have some great documentation on this specific error: Why Do I Get Error -200284 from my DAQmx Read VI?. Although this documentation refers to DAQmx Read, it should be a similar problem to what you are seeing in the DAQ Assistant. I would look specifically at verifying your start trigger configuration and your external sample clock configuration, which are specifically discussed in the documentation.

 

Regards,

Hannah L.

Applications Engineering 

National Instruments 

www.ni.com/support 

0 Kudos
Message 6 of 14
(5,340 Views)

Hi there, thanks for replying again!

I have checked that documentation page and with regard to the trigger, it says the following

"Verify that the trigger is operational and sending its signal properly through the hardware. Next, verify that the hardware can support the line on which the trigger is being sent. Finally, verify that the software task is looking for that trigger on the proper line."

 

We have verified via oscilloscope that the trigger is indeed operational and sending its signal at least to the oscilloscope. We have an input BNC attached to our SCB-68 in pin PFI14, which according to the specifications of the scb-68 and daq card should be ablt to take TTL signals.

 

We have also checked the specifications of the scb-68 and the daq card to make sure that our sample clock, a 400Hz TTL signal wired into the PFO13 input, should be compatible.

 

Is there some acqusition mode of the daq card or scb-68 that we need to enable? So far we have been unable to find a reason that the TTL pulse would not register in a PFI line.

 

Thanks again!

0 Kudos
Message 7 of 14
(5,329 Views)

hexagram,

 

Can anything be input into the PFI line? If you just set it to 5V, is it able to read a high value? 

 

I would verify that you're wiring to the correct channels in your SCB-68 and check to see if you can get any data. There should not be a special mode that you need to put the device in.

 

Regards,

Hannah 

Applications Engineering 

National Instruments 

www.ni.com/support 

0 Kudos
Message 8 of 14
(5,298 Views)

Hi,

Thanks for the suggestion. So we aren't actually sure how to check to see if we are getting anything in on the PFI lines. In the DAQ assistant software on labview the available options for digital inputs don't show any of the PFI lines as available inputs, they instead list ports. We believe that we have wired the inputs properly, but are not sure how to get them to show up on the software.

0 Kudos
Message 9 of 14
(5,268 Views)
Solution
Accepted by topic author hexagram

Many PFI pins are designated with both a PFI number and also a digital I/O port and line designation (such as Pi.j, meaning line j on port i).  Choose one of the PFI connections that has this dual purpose and then you can read the line state using a Digital Input task.

 

Caution: if your trigger or clock signals are fast, you won't necessarily see all the transitions.  You might have a hard time seeing the trigger pulse at all.  But you're pretty likely to see at least *some* of the clock transitions if you keep polling.  They may be many cycles apart, but clocks are often 50% duty cycle, and chance alone will get you landing on different states now and then.

 

Another option is to use a shipping example for counter measurements.  Counters can be configured to use PFI pins as their inputs.  You can try measuring the pulse width of the trigger signal and the period or frequency of the clock.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 10 of 14
(5,264 Views)