Igor control the NI PCI-6602 card (connected to photon detector)

Hello,
 
I am currently using an NI PCI-6602 counter/timer board to measure the number of photons detected by a Perkin Elmer SPCM-AQR series detector. I have used Labview to do all the job with this card. Now I want to use IGOR software to control and plot the data with this card together with other instruments.

Since I am a beginner with Igor program, I need your help for this work. My request is, for example, plot the number of photons (from the NI PCI-6602 counter/timer board) as a function of time.

Thank you very much for your help.

Victor Tai
John Weeks is the NIDAQmx guru, but until he chimes in you can get started by using the examples provided by WaveMetrics. First be sure that you have properly installed WaveMetrics' NIDAQ Tools MX package and the National Instruments drivers. Then, using the National Instruments Measurement & Automation Explorer, check that your PCI card shows up properly, and has a name assigned to it. In your Procedure window, start with
#include <NIDAQmxSimpleEventCounter>
#include <NIDAQmxUtilities>
#include <NIDAQmxUtilities2>

and recompile the Procedure file. In the Igor Data menu, you should then see at the bottom the item "NIDAQ Tools MX >> Simple Event Counter"

This should open up a counter Control Panel; enter your device name, and other terminal parameters, and click "Start"

You may find that further customization is necessary. Read the Tools MX manual to see how this is done with your own programming. Some useful calls and syntax are also found in the NIDAQmxSimpleEventCounter.ipf that you have already #included.
I may be the guru, but Steve has lots of experience and has given you nice introduction.

If you are wanting to collect a time series of counts/time period, you may want to look at "buffered" event counting. You do that with DAQmx_CTR_CountEdges, using either the WAVE or FIFO keywords to specify an Igor wave or FIFO to receive the counts. It also requires that you supply a clock signal using the /CLK keyword. The NI counter/timer functions don't have dedicated clocks for buffered event counting- you have to make it yourself using another counter/timer in pulse generation mode, the sample clock from an analog input scan or waveform generation, or some external source of TTL pulses. If you want to use an external clock, I would recommend learning how to make it work using a second counter/timer first, then move on to using your external source.

To use a counter/timer to generate a pulse train, you use DAQmx_CTR_OutputPulse. Use

#include <NIDAQmxPulseTrainGenerator>

to load a simple controller for pulse generation. Look at the code there to learn how it's done.

Good luck with your project!

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Hello,

I am also trying to read photon counts from a PMT (using an S-series board) and have followed the advice of @johnweeks. I would like to put counts into a buffer that I time with an external counter (let's say it samples the counts at 50 Hz for 2 seconds):

function testCounting()
   
    make/o/n=100 buffer
    DAQmx_CTR_CountEdges/DEV="dev1"/EDGE=1/SRC="/dev1/pfi8"/INIT=0/DIR=1/clk="/dev1/Ctr1InternalOutput"/wave=buffer 0
    DAQmx_CTR_OutputPulse/DEV="dev1" /sec={0.01,0.01} /NPLS=100 1
   
end


Gives me:

print fdaqmx_errorstring()
NI-DAQmx driver error while calling function DAQmxStartTask; device dev1:-50103: NI Platform Services: The specified resource is reserved. The operation could not be completed as specified.
Extended info:
NI Platform Services: The specified resource is reserved. The operation could not be completed as specified.
Task Name: dev1_CTR_0
Status Code: -50103


I guess that I am not taking the correct /CLK but what should it be changed to?