Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

Use analog input as sample clock


    I have a PCI 6115 DAQ card. I currently perform an analog acquisition on ai0, with an external clock on PFI7. But sometimes, my clock signal is not high enough and the acquisition does not occur. At some NI show, I heard a trick to solve this problem : plug the clock on analog input (say ai1), the clock signal gets amplified by the card internal amplifiers, and then route this amplified signal to the sampling clock. This seems to be a wonderfull solution, but I cannot find out to actually redirect the amplified ao1 to the sampling clock. Does someone know how to do it ?

Thanks a lot,

Jérôme Lodewyck
0 Kudos
Message 1 of 6


I do not know the trick you mentioned to amplify the clock signal.

Which NI show was it ? perhaps I could find more details if I know it


Marc L.


0 Kudos
Message 2 of 6
Are you using an analog output signal from one of the AO channels on the 6115 as the sample clock for your AI task or is the analog signal an external signal to the card?  If it's coming from an onboard AO channel, there's probably a better way to achieve the clocking you desire by using a counter.  If it's an external signal, you can use an AO task to program the analog trigger circuit and then use the output of this circuit (AnalogComparisonEvent) as the sample clock source for your AI task.  You may be able to use an AI task directly to program the trigger circuit, but that would require you also use the analog signal as a trigger.  It's not clear whether it's acceptable to you to use the signal as both a trigger and a clock or just a clock.  Also, I've never tried using an analog signal from an AI channel as both a trigger and clock to an AI task.  In theory, it seems like it should work, but it's a bit odd that one of the channels you're acquiring is acting as both the trigger and the clock to the acquisition (sort of a chicken and egg thing).  If you can provide some further details on your signal connections and what you're overall goal is, I can probably point you in the right direction.
0 Kudos
Message 3 of 6

    it was a session called something like "advance programmation with NIDAQmx" during NIDays 2005, in Paris


Jérôme L.
0 Kudos
Message 4 of 6

    thank you for your answer.
    The analog signal I want to use as clock through the card's analog input is external, comming from an optical signal generated miles away...

The configuration currently in use is:

-------------- Analog signal ------------|----------- 6115 card -----
Faint Clock -> Amplifier -> Strong Clock -> PFI7 -> acquisition clock
                                  Signal -> AI0 -> analog input measurement

And I would like to switch to:

-Analog sig- | ------------- 6115 card --------------------------------
Faint Clock  -> AI1 -> Internal amplifier -> acquisition clock
                                         (\-> analog input measurement)
      Signal -> AI0 -> analog input measurement

This would enable to get rid of the external amplifier, and to eventually be able to monitor the clock signal.
It is totally acceptable that the clock signal is also a trigger.


Jérôme L.
0 Kudos
Message 5 of 6

I tested the attached example on a simulated device so hopefully it will work on a real one without any kinks.  You didn't specify your programming environment, so I'm assuming you're using LabVIEW.  If not, hopefully you can translate to the appropriate ADE based on the picture of the block diagram. 

In the example, I'm using an AO task to program the analog trigger as specified.  This has two consequences.  First, you won't be able to perform hardware timed AO while the AI acquisition is running.  If this isn't acceptable, you'll need to try the second approach described in the next paragraph.  Second, you'll have to wire the signal to PFI0 instead of an AI channel.  With this configuration, the signal will be seen with a +/- 10V range and referenced to AI Gnd.  Since the trigger DAC is an 8 bit comparator circuit for this board, you'll have ~80 mV of resolution.  You didn't mention what the amplitude or DC offset (if any) of your signal is, but hopefully this resolution will suffice.  You can use the level and hysteresis properties for the analog trigger to filter out noise in the analog signal or account for DC offset. 

If the constraints listed above aren't to your liking, you can try to use a second AI channel as a trigger channel.  This has some advantages and disadvantages.  The disadvantages are that this requires you to use a trigger with your AI task and it also requires you to acquire another channel of data.  You mentioned the trigger wasn't a problem so this can probably be taken care of with simple analog start trigger.  The data can easily be thrown away, but depending on your sampling rates, it might require a lot of extra bus bandwidth or processing power when scaling the data.  On the positive side, it doesn't require you to use up your AO channels needlessly and you can apply gain to the input signal in order to effectively increase the resolution of the trigger circuit.  You can also apply a low pass filter and different terminal configuration if desired.  The gain, coupling, terminal configuration, filtering, and coupling applied to the signal is controlled by the values used in the Create Channel VI and the Channel Property node.  To create an example that does this, simply start with one of the shipping examples for an Analog Start trigger, change the trigger source to one of the AI channels instead of a PFI or APFI pin, and change the clock source to the AnalogComparisonEvent as shown in the attached example. 

That should do it.  Good luck with your application and post back if you have additional troubles.

0 Kudos
Message 6 of 6