Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

hang during buffered pulse width measurement

Hello,

I have set up my counters for buffered pulsewidth measurement, so that I can count the number of unknown counts within a gate pulse period. 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, to test individual pieces of the program, I wrote the following program, which does the following: set up counter 0 in buffered pulse width measurement, and counter 1 as the gate for it. Ctr 2 just looks for the hardware trigger from the pulse generator, and I also send in a known sequence of pulses to ctr 0. The program works fine and reads everything, BUT only when I am in highlight mode during execution. When I run the VI without highlighting, it hangs in the process of reading the buffer. Putting in loop delays everywhere doesn't seem to help.

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
0 Kudos
Message 1 of 3
(3,457 Views)
Hello Gurudev,

I was able to get your application to run without hanging after making some changes. First, in the buffered pulse width measurement task, I changed the source to be the internal timebase, and the gate to be the default PFI line (Counter 0 Gate, pin 3). To measure period, you count the number of internal timebase pulses which occur while the gate (or you external signal) is high.

Try running the modified VI with an external signal wired to Gate(0),pin 3 and source(2), pin 34.

Does this also hang for you?

Regards,
Sean C.
0 Kudos
Message 2 of 3
(3,440 Views)
Hi,

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 3 of 3
(3,430 Views)