LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pulse counter using DAQ

I have USB-6008 Daq hardware and labview.

I am trying to build a photodiode sensor, so basically my circuit will give out pulses signal (think of it as square wave or sine wave signals). It gives a signal whenever it is triggered. I am trying to count each pulse that occured during the testing.

Now, how can I build a pulse counter. I am just starting to learn to use labview, so I am trying to find the easiest way to accomplish this.

 

Currently, I am using signal generator to test it (with repeating square wave). Can anyone please help? Most of the VI is too hard for me to grasp

Basically, it just needs to count every pulse in real time (and show the count result in numeric indicator).

A sample vi would be really helpful? thank you in advance

0 Kudos
Message 1 of 9
(4,537 Views)

I am trying to use simulate signal fucntion to generate waveform for testing, but it always give me waveform is below zero error for those function that I tested

0 Kudos
Message 2 of 9
(4,534 Views)

The USB-6008 does not have a built-in counter and the Digital inputs are software timed, so counting pulses will not be straightforward.

 

You could use the analog inputs and then find the times which the signals cross a threshold to define the pulses.

 

To get help, it is best if you can post the VI you are working with.  If you can acquire any data at all, Make the Current Value Default on the indicator showing the data.  Then save the VI and post it to the Forum.  Also tell us as specifically as possible what does not work and what you expect the results to be.

 

Lynn

0 Kudos
Message 3 of 9
(4,530 Views)

Currently, I only have a while loop with DAQ assistant function and trying to figure out what to do next after acquiring the analog signal

And yes, the signal coming out from my circuit is analog and I'll be using taking in "analog waveform" using the DAQ assistant and trying to count the number of pulses in real time as it goes

Now, I've also tried using the threshold method (arithmatic comparison function), the problem is how do I count it. There are signal above the threshold as well, so it will keep counting....and not counting each pulse...

Is there a realtime peak counter function (in which we just put in the threshold, so it will set it "on"/triggered when it passes the threshold and count "1" as it falls below the threshold) or something similar?

Not too sure how to go about this.

It's hard for starter like me. Thank you so much for your response in advance

0 Kudos
Message 4 of 9
(4,526 Views)

Rising/Falling edge detector or something similar...

0 Kudos
Message 5 of 9
(4,525 Views)

Rising edge detector requires feedback or memory of the previous condition. Rising edge = previous sample was < threshold AND current sample > Threshold.

 

Two ways to implement this are shown.

 

Lynn

 

 

Rising Edge.png

0 Kudos
Message 6 of 9
(4,521 Views)

I also have "NI USB-6341, X Series DAQ (16 AI, 24 DIO, 2 AO)," but I am trying to make a pulse counter for analog signal

 

I tried to use the "get waveform component" and can't get it to work. There is an error (regarless if I use analog or digital version of the get waveform component function). I am using the "simulate signal" function since I haven't gotten the circuit built yet.

 

The attached vi is far as I can go with what I know. Trying to learn more...

I really appreciate your help so far. At first, I thought creating a pulse counter for analog signal should be easy in labview...

Any extra guide will be appreciated

 

 

0 Kudos
Message 7 of 9
(4,499 Views)

The Simulate Signal VI generates its output as Dynamic Data Type.  Unfortunately NI does not give us any nice function like "get waveform component" for DDT.  You can use the Convert From Dynamic Data function.  Select "1D array of Scalars" from the pop-up menu.

 

<begin soapbox mode>  The EPA Banned DDT because it was killing eagles.  NI (with an eagle logo) should do the same. <end soapbox mode>
 

Lynn

0 Kudos
Message 8 of 9
(4,488 Views)

The 6008 does have an event counter and an example for it - Count Digital Events.VI.

0 Kudos
Message 9 of 9
(4,482 Views)