Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI express alternative to PCI 6602?

We have been using the PCI 6602 to measure the TTL pulses from a photodetector.

The detector signal was connected to the gate of a counter and the internal 20 MHz clock to its source. We performed buffered period measurement and obtained an array of data, containing the time interval between all TTL pulses.

We want to do the same with 4 detectors (count rates up to 3MHz ) in parallel which is not possible with a PCI bus.

Which PCI express card should I purchase for our task?

Are there disadvantages/complications involved in switching to PCIe?

Thank you!

0 Kudos
Message 1 of 29
(4,679 Views)

Hi thomas03,

 

NI does not have a dedicated PCIe counter/timer card.  However... the X Series Multifunction products include 4 counters (as opposed to 8 on the 6602) which have more functionality than the ones on the 6602.  If you just need to measure 4 detectors and don't have any analog requirements, a single PCIe-6320 should be all you need (it's the lowest-cost X Series).  The counter features are identical across all X Series cards.

 

Assuming you are using DAQmx already (as opposed to Traditional NI-DAQ), then the X Series card uses the same driver as the 6602 and caveats should be minimal.  Some of the relevant differences:

 

  • The X Series cards do not have an 80 MHz timebase, but instead a 100 MHz timebase.  The 20 MHz and 100 kHz timebases are still present.
  • The X Series card only has 4 counters instead of 8.
  • The first sample is discarded when performing a buffered period measurement  (image below is for semi-period measurement, but hopefully it shows the idea.  6602 / M Series behavior on the left, X Series behavior on the right):

2011-05-18_105238.png2011-05-18_105301.png

 

 

The X Series throws away the first sample since it is not truly a measurement between two rising edges since the counter is armed asynchronously to the input signal.  If this is an issue, you could instead configure a buffered edge count task to work around the behavior.

 

Your 3 MHz on 4 channels should be sustainable on the PCIe X Series.  In addition to the faster bus, the X Series boards have an on-board FIFO for buffered counter measurements.  Sustained rates have been benchmarked up to 10 MHz on all 4 counters.  The switch between busses should not introduce any complications to the application other than the differences in hardware that I have mentioned above.  If your 6602 application is written in Traditional NI-DAQ then you'll need to re-write the application in DAQmx.  You will of course need a computer with a PCIe slot to use the X Series :).

 

 

Best Regards,

John Passiak
Message 2 of 29
(4,670 Views)

Hi John,

Thanks for your excellent overview! The PCIe-6320 appears to be the alternative we were looking for.

Is it possible to continuously use the counters and process the streamed data without interference of the measurement?

If so, could you provide a link to some example code for c++?

Thomas

0 Kudos
Message 3 of 29
(4,642 Views)

Hi Thomas,

 

Yes this is possible. Data is streamed behind the scenes from the on-board FIFO to a buffer in your host PC's memory.  Your application just needs to be able to pull data from the buffer in PC memory quickly enough to ensure that it doesn't overflow.

 

The code should be the same as what you are using for your 6602 (unless you need the first sample, in which case you can configure a buffered edge count task).  If you are looking for some examples to help get started, they should be installed by DAQmx on your local pc (see here).  Just to confirm, you are using DAQmx on Windows correct?

 


Best Regards,

John Passiak
0 Kudos
Message 4 of 29
(4,617 Views)

Hi John,

 

We have been using the traditional DAQ and will switch to DAQmx.

To loose the first data point is no problem.

How many data points can be stored in the buffer?

 

Thanks,

Thomas

 

0 Kudos
Message 5 of 29
(4,591 Views)

Hello John,

 

As you proposed, I have installed DAQmx on my Windows XP computer and I have found a useful ANSI C Example program: Cnt-Buf-Cont-ExtClk.c

 

Everything is fairly clear except this point:

 

In the instruction I find this:

“Note: An external sample clock must be used. Counters do not have an internal sample clock available. You can use the Gen Dig Pulse Train-Continuous example to generate a pulse train on another counter and connect it to the Sample Clock Source you are using in this example.”

 

I want to use all 4 counters for buffered counting and will have none available for generating a sample clock. How can I get around this?

 

Thank you,

Thomas

0 Kudos
Message 6 of 29
(4,569 Views)

Hi Thomas,

 

My understanding was that you are using the external signals to gate each counter.  Thus, you should be using the external signal as the sample clock source.  You could also configure a period measurement like I mentioned earlier, and by using Implicit Timing this configures the counter to sample off of the gate signal itself.  This has the benefit of resetting the counter on every external pulse, but the downside of throwing away first sample.

 

If you do want to generate a sample clock to sample the counters for some other purpose, I'd suggest using the frequency generator which is a limited counter that can generate a few specific frequencies (see X Series User Manual).  You could also configure a dummy analog task and use the sample clock from it to sample the counters.

 

 

Best Regards,

John Passiak
0 Kudos
Message 7 of 29
(4,560 Views)

Hi John,

 

I have just ordered a PCIe6320. Thanks for your excellent support!

 

BTW, I am not quite as happy with the downloaded c++ reference help and example code.

Is there some more comprehensive material on textbased programming with DAQmx?

I find bits and pieces of information spread out everywhere...

I am almost sure i will have to contact you again after plugging the card into my PC and before getting frustrated 😉

 

Thanks, again,

Thomas

 

 

 

 

0 Kudos
Message 8 of 29
(4,553 Views)

Hi Thomas,

 

In your case I'd probably recommend starting with the Counters section (Chapter 7) of the X Series User Manual--it doesn't give any advice about how to program the counters, but it does give an excellent description of what the hardware is capable of.  Step 1 is to figure out what mode of counter task you want to use to implement your functionality (I suggest using an Implicitly-Timed Buffered Period Measurement).

 

From there, it's a matter of turning your desired functionality into workable software.  The DAQmx Help (which unfortunately is not searchable online) provides more information about how DAQmx implements various hardware-specific features, but it is not ADE-specific.  For example, one of the first things you might notice is that the hardware refers to "Gate" and "Source" inputs, but DAQmx abstracts this from the user.  The following table from the DAQmx Help (Counter Parts in NI-DAQmx) gives more insight to how to refer to the terminals in DAQmx (a period measurement is an example of a "One Counter Time Measurement").

 

        2011-05-25_134850.png

 

Once you are familiar with general DAQmx concepts and features, yet another step is to determine which ADE-specific functions should be used to implement the desired behavior.  That's where the C Reference Help and Shipping Examples come in.

 

 

In short, you're absolutely correct that the resources are much too spread out and disjointed.  There is quite a bit of information available in the various help files, but it can often be difficult to locate.  I know that NI does have a team working to publish the DAQmx Help and C Reference Help online in a searchable form, so hopefully that will make things easier in the future.  Sometimes it's best to just post to the forums or contact NI Support when in doubt so people who have been through it before can point you in the right direction.

 

 

What I'd suggest you do is start out with the "Dig Periods-Buff-Cont-High Freq 2 Ctr", since it almost has everything you need already.  You do need to make some modifications to the create channel however:

 

DAQmxErrChk (DAQmxCreateCIPeriodChan(taskHandle,"Dev1/ctr0","",0.000001,0.100000,DAQmx_Val_Ticks,DAQmx_Val_Rising,DAQmx_Val_LowFreq1Ctr,0,0,""));

 

You will also probably need to increase the number of samples read per loop since your data is coming in so quickly.  You might possily also need to increase the DAQmx buffer size using DAQmxCfgInputBuffer, or by increasing the sampsPerChanToAcquire input of DAQmxCfgImplicitTiming.

 

By default, the period task will use the default GATE PFI line as the external signal to be measured in terms of ticks of the internal 100 MHz timebase. The default terminals can be found in the DAQmx Help, but I'll post it here as well for convenience for the 6320:

 

2011-05-25_141712.png

 

 

If you want to change the terminal to be used for your gate, you can do so with DAQmxSetCIPeriodTerm.  If you want to change the terminal used for the source, you can use DAQmxSetCICtrTimebaseSrc.  If you want to continue using the 20 MHz timebase, there is one available on the X Series, but I'd suggest sticking with the 100 MHz default to give more resolution on your timestamps (especially if the input signals are coming in at 3 MHz).

 

 

Best Regards,

John Passiak
Message 9 of 29
(4,464 Views)

Hi John,

 

Excellent, thanks for your roundup. I will follow your suggestions and try using implicitly-timed buffered period measurement with the 100 MHz timebase. Just waiting for the delivery.

 

Best regards,

Thomas

 

 

0 Kudos
Message 10 of 29
(4,439 Views)