Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Coverting a traditional NI-DAQ gated photon counting application to Ni-DAQmx with the PCI-6602

I think it's fixed. I enabled both the pad sync and synchronous mode. they seem appropriate for how my signals are routed.

the problem turned out to be it was missing a trigger pulse. In this particular vi, i really just want to sample one point. However, the smallest buffer you can set is 2. Therefore I just put my trigger vi in a for loop with 2 iterations. I guess they were too rapid, (even with some delay).

Anyway, for this vi I just trigger once and read only the first point of the buffer. It seems fine. For my other buffered measurements with >1E5 points, the trigger pulses will never come less than 4-5ms apart. This also seems to work fine now with no dropped points


So, thanks again for your help!!

regards
justin
0 Kudos
Message 11 of 14
(1,781 Views)
Hello,

I had actually also set up my counters in a similar mode because I need to do the same thing. But I couldn't get it to work. The way my system works is that I have an external timing generator, which sends the hardware trigger on SRC of counter 2. It also generates gate pulses for counters 0 and 1, which are sent to the PFI lines 38 and 34 respectively. I set up both counters 0 and 1 in buffered pulse width mode, and counter 2 in simple event (so that I can determine how many triggers I received). The unknown signal comes in on the SRC of counter 0 and 1, and I want to measure how many counts I get during the gate pulses. Now, I have tested individual pieces of the program, by sending a known set of pulses to both counter 2 and counters 0 and 1. But for some reason, the buffers in counter 0 and 1 are always empty. Also, even though counter 2 will count if I send a known sequence of pulses, it never seems to count the pulse I send from the timing generator. And therefore it enters an infinite loop. I have used the timing generator with the NI counters before for other programs, so I know they can work together (in terms of voltages and currents etc). After reading this post, I have tried to enable pad synchronization and synchronous counting also, as seen in the program. Actually, I am not sure I have enabled pad synchronization, as the labview help is not very clear on this. But I still can't seem to get any counts.

I am attaching the program I wrote. If somebody could take a look and figure out what I mgiht be doing wrong, I would be really grateful.

Thanks,
Gurudev




@justin_j wrote:
Hi, I'm trying to convert a 2-channel gated photon counting module to NI-DAQmx. There seems to have been a paradigm shift in how the new VI's are defined as gates do not seem to be explicitly included anymore.

This module is intended to work with counters on a PCI-6602 card.

Counters 0 and 1 are run in buffered pulse width measurement mode. The signal source to be counted is attached to PFI39 and 35. The gate for each (to ensure synchronization)is set to RTSI0.

Counter 2 generates the gating pulse and the output is sent to RTSI0. It is triggered by a digital pulse on a DIO port.

The VI Two_channel_gated_photon_counter included in the attached library continuou
sly acquires 1 sample. In actual operation, a buffer it set up for each channel and one sample is acquired for a series of gate periods triggered by the a series of ditial pulses. At the end of the meaurement, the buffer is read out containing the full N samples

Since the 6602 is just supported in DAQmx as of last month, the documentation is sparse and intended for traditional DAQ. I would appreciate help in converting this VI. thanks


0 Kudos
Message 12 of 14
(1,716 Views)
Hi Gurudev-

I am unable to run your program because it is looking for what appear to be custom NI-TIO VIs. This brings up another question- the E Series cards should use DAQ-STC VIs because they do not actually include the TIO chip.

Can you please let us know which card and the version of NI-DAQ you are using? Also, if you could post a library that includes all of the subVIs that are missing it would be easier to work with.

Thanks-
Tom W
National Instruments
0 Kudos
Message 13 of 14
(1,698 Views)
Dear Tom,

Thanks for replying. I have fixed my problem. It was because when I was testing the program, i didn't send enough pulses within the time period of the trigger. I changed the pulse specifications and it worked. I have also gotten the main program working now. Once again, thanks for your time.

Gurudev
0 Kudos
Message 14 of 14
(1,691 Views)