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

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
Attachments:
Pulse counter.jpg ‏79 KB

Similar Messages

  • Pulse Counter using LM3S8962

    Hello,
    I need the display and control this following points on EKK-LM3S8962 ARM board
    Generate the pulse signal.(as shown  in excel file)
    After generating the pulse, 2 pulse is missing after 34.Then again start from 0-34(2  missing) as it continues.(as shown  in excel file).
    At every 34 pulse I need to synchronize the cam single (as shown  in excel file).
    At very synchronize I need to count and display on front panel.
    Please help me out as I am new to LabVIEW.
    Attachments:
    CrankSignals_Ref.xls ‏183 KB

    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
    Attachments:
    Pulse counter.jpg ‏79 KB

  • Compare two pulse counts

    Hello,
    I'm trying to compare two simultaneous pulse counts using a cDAQ-9172 chassis, a 9401 card, and LabVIEW 8.2. What I want to do is set up a single output pulse that lasts for, say, 1000 incoming pulses on ctr0, and then use that single output pulse as a gate on ctr1 to count the input pulses that it sees during those 1000 pulses on ctr0. In other words, I want to synchronize the two counters, and as soon as ctr0 reaches 1000 pulses, they should both stop so I can compare the two counts. The issue is slightly complicated by the fact that both counter inputs are very noisy and require a pulse width filter in order to be read properly.
    I more or less understand what needs to happen conceptually, but I'm at a loss for how to make it happen. A simple walkthrough would help enormously. Alternatively, if there's a better way to accomplish this, that would be helpful as well.
    Thanks.

    Thanks for the advice. I set up a program (attached) that tries to implement basically what you suggest, but there are still problems. The main issue is that it gives me an error -200141 message telling me to change the data transfer mechanism to DMA. When I set up a channel property node to do this, it tells me that DMA is not available.
    The other concern I have involves the pulse width filter on the counter output task. The 1000 pulse signal is extremely noisy, and without any filtering, the noise will increase the frequency by a significant amount. I've set up the filters as you can see in the program, but I have no idea whether I've done this properly.
    Any further help you could offer would be greatly appreciated.
    Attachments:
    even more gating.vi ‏39 KB

  • How to generate a pulse waveform 90 deg phas shifted with respect to a pulse generated using a counter in PXI 6070E daq card ?

    Hi
    I ma using 6070E daq. I am generating a infinite pulse train using one of the counters. I want to generate another pulse train which should 90 degress phase shifted with respect to the previsously generated pulse. How to implement this using the counters in the DAQ card.

    Hi Gopal,
    1) yes the frequency generator is programmable. You have 2 timbebases (10MHz and 100kHz) and you can divide down by any integer between 1-16. Those are the only frequencies you can use.
    2) The way counters work is that you can apply a gate signal to the counter which will cutoff the output. Therefore, you can have a second counter generating a pulse train of an equivalent frequency to the frequency generator (fout) but you don't want it to start immediately. You want it to start only after a short delay (equivalent to a 90d phase). Therefore, you need to "gate" or prevent the output on this counter for that small delay period of time. The way you can do this is by using a second counter to create a delayed pulse. You would
    connect the output of that counter to the gate of your pulse train function. That way, during the delay period of the pulse, you won't be outputing your pulse train yet. When the pulse (high-time) of your pulse reaches the gate, then your pulse train will start generating its pulse train (which is consequently delayed by the amount of delay used in the single delayed pulse counter). Since you don't want your pulse to go back low, you will have to turn off or clear your pulse counter while it is high. That way the signal on the gate will remain high forever.
    Your better solution is to use a PCI-660x card to perform this action. You will have more counters which will give you a greater range of frequencies to choose from and you will have more accurate timing of the signals.
    Anyway, hope that clears things up. Have a good day.
    Ron

  • Using counter (6024E DAQ STC)

    Hi everyone,
    i'm very new to Labview and what i want to do is very simple.....but i can't make it work.
    I'm trying to count events from an external TTL signal. I have loaded Count edges(DAQ STC).vi. I haven't changed anything in the default parameters so i have:
    -counter0
    -source is set at PFILine -> default & polarity positive
    -gate is set to misc -> Low and polarity negative
    I have connected my TTL + signal to PFI8/GPCTR0 and the - signal to DGND. When i start the vi it counts way too much and the count doesn't seem to be correlated in any way with my TTL signal.
    The frequency of my ttl signal is very low (<0.5 Hz) and the signal is good (no noise at all).
    What am i doing wrong? I have changed the setting from PFIline -> de
    faults to PFI8
    any help would be really appreciated.

    From your explanation, your connections seem to be OK and you're using the VI correctly. When using the default settings, you should connect your signal to the source of counter 0 (pin 37) and the negative side of your signal to a digital ground.
    Is your signal truly a TTL signal? There are certain specifications (rise time, fall time, voltage level, etc..) which the signal must meet to be TTL. I have an E-Series DAQ device and I can run the same program with a slow digital signal and it works perfectly. So, the only thing I would suggest is to make sure that your signal is a digital/TTL signal. The document below goes over the definition of a TTL signal.
    I hope this helps.
    What Is the Definition of a TTL (Transistor-Transistor Logic) Compatible Signal?
    http://digital.ni.com/public.nsf/websearch/ACB4BD7550C4374C86256BFB0067A4BD?OpenDocument
    Regards,
    Todd D.

  • Can I Control the Pulse offset using the Counter Out?

    Hello Everyone.
    I am trying to generate the Pulse as below;
    I have seen and understood an example to generate a pulse waveform "GenDigPulseTrain_Continuous".
    However, I can not control the offset of the pulse train.
    Although the function gives me "initial delay(The amount of time in seconds to wait before generating the first pulse)",
    I can not shift "t_dead" cycle.
    /*01.Frequency Control*/
     // The units to use to define pulse frequency.
      m_pTaskWrite->COChannels.CreatePulseChannelFrequ​ency(vecstrings[0]/*LPCTSTR counter*/,
       "PWM_C0_CH_HIGH"/*LPCTSTR nameToAssignChannel*/,
       DAQmxCOPulseFrequencyUnitsHertz,
       DAQmxCOPulseIdleStateHigh,
       dDeadTime, 
       m_nFncFrequency/*frequency*/,
       prDuty.second/*dutyCycle*/);
      // The units to use to define pulse frequency.
       m_pTaskWrite->COChannels.CreatePulseChannelFreque​ncy(vecstrings[1]/*LPCTSTR counter*/,
        "PWM_C0_CH_LOW"/*LPCTSTR nameToAssignChannel*/,
        DAQmxCOPulseFrequencyUnitsHertz,
        DAQmxCOPulseIdleStateLow,
        dDeadTime/**2 + (prDuty.second *dCycleTime)*/, 
        m_nFncFrequency/*frequency*/,
        prDuty.second/*dutyCycle*/);
    Please let me know how I solve this problem.
    Thank you

    Dear Zl,
    Counting pulses is much easier with the FP-QUAD-510 or FP-CTR-500, but can be done with the FP-AI-110.  You can't directly count the pulses with a FP-AI-110, but you can do it in software. Bring in the data by doing a normal read. Then, using shift registers, if the previous voltage is less than .8V (low) and the current voltage is more than 2.5 (high), increase the pulse count. I have attached a program that shows what to do with the data once you bring it in. I took the data from an array outside the while loop, but your data will be brought in one point at a time inside the while loop. One thing to take note of, since Fieldpoint brings in data at 1 kS/s, this will only work with pulses slower than 500 Hz. The farther the duty cycle is away from 50% duty cycle, the slower the signal must be in order to catch the pulses correctly. Please let me know if you have any questions. Have a great day!
    Sincerely,
    Marni
    PS- Please only post question once.
    Attachments:
    pulsecount.vi ‏22 KB

  • Read no. of pulse count with fixed time interval

    Hi,
    I am try to read no of pulse count ( Pulse period = 500ms, On time = 100msec and Off time = 400msec). Between pulses there is a fixed time interval of 2seconds. I am using NI USB DAQ 6341. Can anybody help me regarding this? 

    Thanks for replying. I have gone through  that example, the given example are only increment count when pulese are detected.
    In my case, i want to count the no. of pulses between the time interval of 2sec. e.g. Suppose my device generate 5 no. of pulses and after every 5 pulses their is 2sec time interval, here i need to read only 5 pulses not the continuous count. And no. of pulses are generated by device can be vary but the time interval between those pulses are fixed. Could you give me suggession regarding this?

  • Servo motor encoder pulses/counter data erroneous

    First off, I am very new to using labview.  I am trying to complete a project a former employee was working on.
    For a quick background on what I am working with, I am using a NI DAQCard-6036E connected to a SC-2345.  The SC-2345 is then connected to a load sensor, Omron R88D servo driver, and an omron servo motor.  The servo motor has a incremental encoder with a resolution of around 2048 pulses per revolution.  My labview program includes a counter that records the data from the encoder on the servo motor.  I have been able to get accurate data when testing through the measurement and automation program by manually turning the motor.  Also when running through the specific DAQ assistant I am using for my counter, I am getting correct readings when manually turning motor.  Once I run my complete program, instead of getting 2048 pulses per revolution, I am getting between 34000-36000 pulses per revolution.  The most logical assumption is that I am getting vibration in the motor itself or some sort of noise is interfering with my signal.  I first attempted to change any possible settings through the omron servo driver that might reduce any vibration in the motor.  I attempting changing the rigidity settings, turning on and off the auto-tuning function, and a few other settings specified by the user manual that might cause vibration.  If I turn the rigidity settings as low as possible, I am able to get around 2000 pulses per revolution, but the data is very sporadic. Also, my equipment needs to be very rigid, and with the lowest rigidity setting for the servo driver, I am able to almost stop the motor with minimal force.  My equipment needs to be able to travel at a near constant speed with fluctuations of up to 200 N of force.  Any suggestions on which direction I should go in finding a countermeasure? 
    Thanks
    Solved!
    Go to Solution.

    The model number of the servo motor is R88M-W10030L.  The servo motor rotates at a constant speed.  The program is designed to drive the servo motor connected to a ball screw in one direction.  Once the load sensor reaches a desired load, it will reverse at a constant speed until no load is on the sensor. Throughout, it records load vs. displacement.   I have found a few things that will alter the pulses counts.  If you apply resistive pressure on the servo motor while it is rotating, the pulse output will vary.  Also when you apply pressure to the casing of the servo motor itself, the pulses will often jump around. I was almost certain my false pulses were caused by vibration.  After have no success adjusting settings to reduce vibration(according to the user manual), I ran the program while moving around several wires to see if any were loose, etc... After applying force to the power lines and encoder cable, the program ran several times with an average of 2000 pulses per revolution and would actually subract pulses while going in reverse(what I want it to do); Although the average was around 2000 pulses per revoltion, i saw positive and negative jumps in pulse counts while traveling forward at constant speed.  Today I re-wired the equipment, seperating as many wires as possible.  After the re-wire, the equipment/program is back to sending 34000+ pulses per revolution, and does not subract pulses while reversing.  I have read the 'Using Quadrature Encoders with E Series DAQ Boards' article.  Referring to the article, I am running similar to "method 1".  I am already using a signal conditioning box, but have the counter data run directly through. Do you believe running the signals through a SCC-CTR01 might solve the problems? 

  • How do i develop code in LabVIEW 7.1 for configuring and performing gated edge counting using NI-DAQmx

    Hi,
    My application requires DAQ counter channel to count the rising edge of the input signal connected to the source pin of the counter. This counting has to take place only when there is a high pulse in gate pin of the same counter.This can be developed easily using traditional daq vis.
    Please let me know how to develop code using DAQ mx.
    Thanks,
    Sudha

    There is an example that demontrates how to do this in DAQmx called "Count Digital Events-Pause Trig.vi".
    gus....

  • CDAQ module for high speed pulse counting

    I need to know a USB module which can be used for pulse counting. The pulses are generated from an encoder attached with an stepper motor. It generates 15 pulses per step.Pulse amplitude is 0 to 5V. I am using a compact DAQ system (ni 9178).

    The counters are on the cDAQ chassis backplane (there are 4 of them on the 9178).  So, in order to use an external signal with the counters you would need a way to route the signal to the backplane.  Your available options are:
    1.  Any digital I/O module with 8 or less lines on it (some modules are input-only or output-only--input modules can be used for counter input tasks only, output modules can be used for counter output tasks only).  Modules with over 8 lines transfer the data serially to the chassis backplane and so do not support routing signals through to the counters.
    2.  The 2 PFI lines on the 9178 (I should have mentioned this earlier, this might be a good option for you to route your encoder pulses without having to purchase an additional module if you only need 2 inputs--that is, no Z index signal).  The bandwidth on the chassis PFI lines is lower than that of the 9401 and 9402, I believe the chassis PFI lines should take signals up to ~1 MHz.
    3.  An analog module with triggering capabilities (at this time only the 9205 and 9206) can route a digital signal (the 9205 and 9206 have a PFI line) or an "analog comparison event" (see my post here) to the counter terminals.
    In case 1 above, you configure this by selecting the counter using the module's name (e.g. "cDAQ1Mod2/ctr0").  Default input terminals will be used (check the device pinouts for your module in Measurement and Automation Explorer) or you can select which terminals to use for your inputs using a DAQmx channel property node.
    In cases 2 and 3, you would need to select the counter as the internal backplane counter (e.g. "cDAQ1/_ctr0").  You will need to select which terminal your signal is coming from (since the internal backplane counter does not have default terminals.  This same method can be used to count internal signals (e.g. sample clocks, counter outputs, etc.) without having to use any of the 3 routing options mentioned above.
    Best Regards,
    John Passiak

  • Ramping a pulse signal using PCI-6602 card

    I'm controlling a stepper motor and need a continuous pulse output with variable frequency. I need to accelerate and decelerate teh motor (It can't start immediately at a high frequency but needs to be ramped up to it). I can't have any hiccups in the signal or the motor can stall. It seemed I had my own ramp program written (which gradually increased the frequency value sent to the counter) to solve this problem, but when I switched to Office2000 I started getting hiccups in my signal. I also have a PCI 1200 card and could use A/O but I think using the counter signals would be better. If I'm wrong let me know. Once I have the motor up to speed I am reading in a pulse signal to analyze with FFT.
    thanks for y
    our help.

    A few thoughts & musings, hope some of them are useful:
    1. The sequence for setting a new frequency should be to first load up the new pulse specs (use 1 & 2, not 3 & 4), then issue the "switch cycle" command to 'Counter Control.vi' You can look at NI's example program called 'Pulse Width Modulator' to verify syntax.
    2. If your frequencies are low enough and your loop time is fast enough, you may be trying to update the pulse specs before the previous specs have completed a full cycle. This has traditionally been a no-no, though I'm not 100% sure that it remains one with the latest NI-DAQ drivers.
    3. No ideas about the possible interaction with MS Windows and/or Office 2000. Haven't used either.
    4. (My own latest installment in a multi-year running gripe at NI): Wh
    en oh when will we be granted the ability to perform buffered counter OUTPUT operations? Just as in the analog world, one can acquire a signal with AI and then reproduce it with AO, it would be REALLY REALLY handy in the counter world to measure with buffered semi-periods and then reproduce the same pulse train with a buffered output.

  • How to measure pulse height by DAQ card

    I want to record pulse signals (fast pulse) and measure their amplitude (height) using DAQ card

    :-) I heard that problem before. Is it possible that we disscused this subject some time earlier?
    Well, but to your problem. How many counts do you get per second in average? I work/worked at a similar problem to analyse the counts from a 2D-detector. I tried the VI mentioned above but it was never able to analyse 1000 counts per second as a order of magnitude.
    Which shape has your pulses? Are they NIM or square shaped? How stable is your underground and of which order of magnitude is it? How fast is your DAQ board? Because according to the Nyquist theorem you will need a sampling rate of approx. 1MS/s to resolve them properly!
    Stephan

  • ABOUT internal timing/counter of DAQ

    I am using DAQ 6014 to get the analogue waveform? Does DAQ6014 have any internal timing and counter which I can use to sample the data of waveform? If not, how to do this? I checked user manual and also don't know is the CTR, ICTR or GCTR can be used in DAQ 6014?

    The NI 6014 has an internal clock that you can use to set the scan rate of analog input. There are several example programs that use the LabVIEW or NI-DAQ function calls that illustrate how to set the scan rate of an analog input acquisition.
    In LabVIEW, the AI Start VI has a scan rate input with which you can control the rate of analog input. If using NI-DAQ function calls, the DAQ rate function has the rate input parameter with which you can set the scan rate of the input acquisition.
    The 6014 also has two onboard counters that can generate a digital pulse train and you could use that pulse train as a clock for the analog input. But, if you are just wanting to set a scan rate for the analog input, you won't need to use a counter on the device. I hope thi
    s helps.
    Regards,
    Todd D.

  • Flow Meter VI - Pulse Count - Help Needed

    Hi,
    I am working on developing a Flow Meter VI, I am using a flow meter with a pelton wheen that outputs a stream of pulses in proportion to flow.
    The flow meter output is attached to the counter line of my 6501, and the pulse count is multiplied by 1.41 (per datasheet) to give ml.
    I have the attached VI but not sure exactly what it is doing, would someone mind explaining how it works and how it could be optimised, thanks.
    Regards,
    Ger
    Attachments:
    Flow Meter.vi ‏52 KB

    Hi Ger,
    Looking at the VI it seems to be just acquiring some data off of your 6501 card, and just edge counting the number of pulses received and then processing the data to give the result of flow. It seems fairly simple in terms of what it is doing, but there are a few optimisations I can reccomend to you. In your VI there is an unused shift register in the first for loop which I would reccomend removing as it doesn't seem to be strictly necessary. In the second for loop, there is an uninitialised shift register, and I would reccomend that you initialise that with a suitable value unless you specifically need it, as otherwise it will just use the default value of the data type, which in this case is 0.
    Another optimisation you could use is replacing the DAQ assistant with DAQmx functionality however considering how simple this code is currently, the DAQ Assistant should not cause a problem, however if you wish to expand it in the future I would reccomend looking into using the lower level DAQmx VI's.
    Best Regards,
    James Kent
    James Kent | Applications Engineer | National Instruments UK & Ireland
    w: uk.ni.com | ireland.ni.com

  • When using DAQ assistant to read frequency

    When using DAQ assistant to read frequency and Task timing is set to:
    N Samples, Clock settings to read 26,
    Frequency setup to rising edge,
    1 counter with 10 kHz to 1 kHz range.
    I get back a single number.
    Can I assume this is an average reading of 25 samples with the first sample unused?
    What is the base clock used?
    Is the “26” 26 cycles of the frequency to be measured?

    Hello,
    If you choose to acquire N samples from the DAQ Assistant then it will acquire all of these samples and return them to LabVIEW as an array.  However, when you use the DAQ Assistant it outputs the data in the dynamic data type first.  This data type makes it easy to graph and run the data through other express VIs.  If you were to create a Numeric Indicator from this data type it would just display the last element from the dynamic data array.  To display this data properly in a numeric format convert the dynamic data to an array of doubles by using the Convert From Dynamic Data function in LabVIEW.  Then you can select to convert it to a 1D array of scalars and when you create an indicator off of the output of this function all of the data should be displayed.
    The timebase that is used for lower frequency measurements is the onboard clock, which is internally connected to the Source.  Then you connect your signal to be measured to the Gate of the counter.  Since the frequency of the onboard clock is known it can be used to calculate the frequency of an unknown source based on when the counter is on and off (determined by the Gate). 
    Have a good day,
    Brian P.
    Applications Engineer

Maybe you are looking for