High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous pulse counting

Solved!
Go to solution

Hi, I have a PXI-5152 digitizer with two channels, one to read the voltage signal and the other to read the current signal from an electrical discharge machining (EDM) process.

 

I want to count the pulses generated in the process, at the moment, what the code did was first to acquire certain number of data points then pause to process the data in a while loop to count the pulses on rising or falling edge triggering. The reason to do that is also some other information of the data points are extracted in the while loop. But in this way, I can't count all the pulses geneated in the process due to the acquisition and pause cycle.

 

Is it possible that I can write a code to only continously count the pulses (rising or falling edge triggering) during the process? The process may last more than half an hour and number of pulses generated could be a few million?

Or do I need an additional card for the purpose?

 

Any help will be most appreciated!

 

Cook

 

 

0 Kudos
Message 1 of 7
(7,307 Views)

You can of course use a counter or multi-IO card, configure it to edge or pulse counting and count up to 2^32-1 events (64 bit counter by cascading also possible).

 

But if you already have a vi to count the pulses with your analog channel, you can try a producer consumer architecture. (See templates and examples).

Mean you sample continuously and read the data in blocks (producer) and process them(consumer).

Things to optimize:

Samplerate (should be as low as possible)

Blocksize

your vi to count the pulses (post your vi if you need hints how and where to optimize)

 

However if you have other use for the digitizer and only want to count the pulses (maybe need some analog preprocessing)... counting with a few 100kHz should be no problem for any counter. (OK, maybe except the USB-600X...)

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 7
(7,288 Views)

Hi Henrik,

 

     Thanks for the reply, I didn't check the forum recently.

 

     I attached two VI. The first one is what I have now, it's a simple program which first acquires data, then count the pulses in the small while loop. For one of my testing cases, the acquistion part is about 300 ms, and the counting part is about 200 ms, which means for each acquisition and counting cycle, I lost about 500 ms data in real time perspective.

 

     I tried to implement producer consumer architecture from the example (https://decibel.ni.com/content/docs/DOC-3441) to my case, but could not manage it, the second one shows some trials I made. It will be great if you can give some suggestions. 

 

Cook

0 Kudos
Message 3 of 7
(7,204 Views)

here is a 10 min try 🙂

I started with an example and add the producer consumer .

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 7
(7,189 Views)

Hi Henrik,

 

            Could you change the VI version to 11.0 and attach it again?

 

            Thanks!Smiley Happy

 

Cook

 

0 Kudos
Message 5 of 7
(7,186 Views)
Solution
Accepted by topic author cookwang123

here it is 🙂

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 6 of 7
(7,172 Views)

Hi Henrik,

 

         This is not exactly what I want, but it works fine for direct pulse counting purpose, and I can start with your program for my case. It will be very nice if you could help again when there is further questions.

 

         Thanks again.Smiley Happy

 

Cook

 

         

 

 

0 Kudos
Message 7 of 7
(7,131 Views)