How to measure the frequency of a pulse being generated by a counter

Hi,
I am using labview 8.6 to generate 5 evenly spaced pulses for every 1 revolution of my shaft. However, I would also want to know the frequency of these pulses so I can determine the shaft speed. Since I am already generating the pulses using one of my counters, can I still tap into that or task another counter to measure the pulse frequency? If so, how? I have attached my code for generating the pulses and I am using an Ni 9401 module and an NI 9172 chassis. If someone can helo me modify the code to measure and tell me the pulse frequency as well, that would be really appreciated
Attachments:
autotrain2.vi ‏19 KB

You'd probably get a more coherent answer if you didn't bounce around from thread to thread so much...
How can I generate a pulse train from shaft encoder? (5/13)
pulse train from encoder (5/15)
how to measure rpm (5/20)
How to measure rpm using shaft encoder and labview (5/23)
This thread (also 5/23)
I see you ignored my suggestion from the other thread--Kevin's solution is good too but using an encoder task offers more noise immunity (I think this is probably the cause of the problem you reported on the other thread).  You can fix it with digital filtering if you want to keep using a counter output instead of an encoder task.  Noise during transitions is pretty common for a quadrature encoder.
A finite counter output task uses 2 counters on the 9172 (although you said 9174 earlier at one point--this wouldn't be the case on a 9174) so you wouldn't have one left to make your frequency measurement.  With the solution you have now, you can change to continuous to free up a counter if you don't care about outputing an exact number of rotation's worth of pulses (I'm not sure if you do or not--I didn't read through all of the various threads relating to this application to find out).
For your actual question in this thread...  Have you tried running one of the frequency measurement examples?  From the code here I can't tell what you have tried (it just looks like a mangled version of the code Kevin gave to you in your other thread).
Best Regards,
John Passiak

Similar Messages

  • How to measure the frequency of the data plotted on the waveform chart

    i have made a virtual instrument in labview that acquire data (say sine wave) into a spreadsheet file and also on the chart from the function generator. I measured the frequency of the data from the chart but it is coming out to be very less. How can i calculate the frequency of the plotted sine wave and also from the spreadsheet file.

    If you want to get an idea of the base-frequency of an periodic signal, you can measure the number of samples in between two maxima or in between two minima of the periodic signal.
    Multiply the number of samples by the sample-interval (1/Fsample in [sec]) gives you a rough estimate.
    FFT, I mentioned is one of the more advanced calculation-methods.
    The method calculates the spectrum from a waveform.
    Hope this helps,
    Patrick

  • Help with measuring the frequency of a pulsing signal

    Hi,
    I am trying to use LabView to measure the flow from my ultrasonic flow meter. The meter sends a pulse for evey 10 litres of flow: I am picking up the signal in LabView without any trouble - it's basically a square wave that pulses at 10V and goes back down to 0V for the same duration.
    All I need to do is measure the frequency or period of the wave, but I have had no luck with any of the vi's. They seem to focus on the wave when it's either at 10V or at 0V and return the period as infinite or 0.
    I then attempted to program a sequence which returned true if the signal was =1 (the rising edge of the pulse), if true it would go to the next step, check again if =1 (falling edge), if true go to the third step and check if signal =1, and time that sequence, giving the period of the wave. Unfortunately this didn't work either.
    Any suggestions?
    Cheers,
    Liam

    Hi, I have the same problem - my LabView edition is Student so I don't think I can access them.
    Unfortunately the problem is still persisting. I have been working with someone who is quite experienced with LabView and he can't solve the problem either.
    There was some progress when I used the Trigger and Elapsed time .vi's to measure the time between rising edge pusles. Since the pulses were quite slow, by putting the period-to-flow conversion equation in, the flow could seen reducing to a minimum value as the elaspsed time increased to the full period. I have fitted new, more accuarate flow meters into he pipes which now send 100 pulses for each litre of flow. These flowmeters now pulse so quickly that it's impossible to see what the minimum flow value is to get the flow.
    If anyone knows of a way to select the maximum time value (i.e. the full length of the period of a square wave) that would be one solution to the problem. Any other suggestions on the best way to measure square waves would also be gratefully received.
    Thanks in advance
    Liam

  • In NI-DAQmx, how to change the frequency of a pulse train?

    I was using "GPCTR_Change_Parameter()" to change the frequency of my pulse train in Traditional NI-DAQ and Labwindows/CVI; is there any function can do the same thing in NI-DAQmx without restarting the task?

    You can do this in one of two ways, depending on the version of NI-DAQ you are using. If you are using 7.2 or later, you can use the counter write functions (ex: DAQmxWriteCtrFreq()), which are available for each flavor of pulse generation tasks (Freq, Time, Ticks). If you are using NI-DAQ 7.0 or 7.1, you can modify the attributes directly (DAQmx_CO_Pulse_HighTime, DAQmx_CO_Pulse_LowTime, etc). Keep in mind that for each attribute pair, one of the attributes will cause the counter to load the new pair. The attribute that causes the load is LowTime, LowTicks, and Frequency.
    I hope this helps!
    gus....

  • How to modify the frequency of a pulse generator without stopping application

    I need to generate pulses on a counter output of a 6024 card. But I have to change the frequency while the programm is running between 1Hz to 800 Hz.
    If I do the initalization on each loop, the system becomes very slow and I can't reach 800Hz.
    Anyone can help me?

    Good news -- you can change the frequency on the fly with no skipped pulses. You'll find a couple examples posted here on ni.com by searching on "pulse width modulator". One's for traditional DAQ, the other's for DAQmx.
    Possible caution -- not too many NI-DAQ's ago, there was a limitation about changing pulse specs on-the-fly. I'm not sure whether it still applies to the latest traditional NI-DAQ or to DAQmx. Caveats aside, here's what that limit was (is?):
    -once you set new pulse specs on-the-fly, you must allow at least one new pulse to be generated before the next time you set new pulse specs.
    Your frequency range is low enough that you'll likely need to put extra delays in your code to keep it working smoothly.

  • How to measure the rotational speed by using rotary encoder and 1 counter?

    I want to measure the rotational speed of a shaft, and I have below hardware:
    1, a rotary encoder, with A,B,Z signals output;
    2, PCI-E6363 card.
    I do konw how to use such a  encoder to measure the rotational angle by using the function "DAQmxCreateCIAngEncoderChan", but this time I need to measure the speed(rpm), as well as the dirction of the speed, which means a negative speed represent a CCW rotate direction.
    More detail informations:
    for the encoder, the A,B signal is 600ppr, and Z signal is 1ppr
    the rotatinal speed is in range: -300 ~ 5000 rpm.
    some one suggested me that I can use the "DAQmxCreateCIAngEncoderChan" task to measure the angle firstly and then do the differential analysis with the angle. but I have to enable the Z index function, and it's hard to calculate when the shaft speed is fast then 2500rpm.
    Anyone can help me on this issue?
    Thanks in advance!

    RobertoBozzolo:
    Thansk for your reply. You are right that measure frequency to get the speed is the best way, but it's hard to get the dirction at the same time. You suggest me that "perform two angle measurements to get the sense of rotation", but I'm not sure I catched what you mean about this. I try to understand your opinion like this: distribute the signals to 2 counters, and start 2 tasks, one for frequency, the other for angle which used for deciding the dirction?
    And by the way, in my application, the counter is limited:
    I'm using PCI-E6363, which have 4 counters totally, and I have to measure 4 different speed sensors at the same time, so that means only 1 counter for me to measure the speed and the dirction.
    RobertoBozzolo 已写:
    To measure the speed from the encoder you can simply follow some of the frequency measurement examples that ship with DAQmx, considering that speed (rpm) is given by frequency (Hz) on one encoder output / 600 (ppr) * 60 (s->min)  = frequency / 10.
    Difficult is to add a sign to this measurement: frequency measurement gives you no information about sense of rotation, so I suppose you could perform two angle measurements to get the sense of rotation and then get the speed as above.

  • Wiring a SCB-68 to measure the frequency of a TTL pulse signal

    Sorry if this is a basic question but could someone please help me and tell me how to wire up a SCB-68 connector block (connected to a AT-MIO-16 DAQ board) so that I can measure the frequency count of a series TTL pulses (signal from photon counting). At the moment I don't understand how the PFI1-9 connections are related to the GPCTR0/GPTR1 counter connections on the block and how they're all realted to the source,gate and out 1-5 connections on the DAQ board.
    Ultimately I want to be able to put this measured frequency into a Labview program with a controllable gate period.
    Thanks in advance
    Nick

    You might want to search the Knowledge Base on the NI's Support Pages for "Cable Mapping for a 68 Pin Connector to a 50 Pin Connector". This should take you to a link that will explain the mapping of a 50way to 68way cable and subsequent lines you are looking for ( reference sub link 68F50M), I guess you have SH6850 cable connected from the AT-MIO16 card to the SCB-68.
    Please check out the information about the pin outs, that should help you work out which pins map to the counters, eg GPCTR0_source would be pin 37 on your SCB-68
    Regards
    Joe (NI)

  • How to measure the baseline of a noisy, pulsed signal

    Hi
    I am measuring the torque exerted by a large motor on a shaft using a load cell and lever arm. The shaft runs at approx 150 rpm. I have attached a drawing that shows the output I get. This is a test rig.
    I have written some code that measures the maximum peak out of a group of approx 5 peaks and writes this to a shift register. This gives me an idea of the maximum torque "spike".
    I also wish to measure the baseline torque (due to the bearings in the machine). Even when highly filtered (my noise filter is set to 49Hz) the signal exhibits this noise which is probably due to vibration in the system. The signal is zeroed when the motor is not running.
    Does anyone have an ideas on how to measure the "baseline" torque? The large spike in torque prevents me from doing a running average. Can anyone think of a way of averaging just the noisy part of the signal to get an average value? I aim to to subtract the average baseline torque from the peak value to get an idea of the torque due to the event which causes
    the spike.
    Any help would be greatly appreciated.
    Many thanks.
    Attachments:
    drawing of torque signal.gif ‏26 KB

    Thanks for the reply. I understand what you are saying. However, I might have to modify my method for measuring the peaks if I choose to implement your idea. I have taken a screenshot of my "peak finder" code and attached it.
    Bascially, the reset terminal is wired to a timer which outputs a pulse every few seconds. This resets the vi (a standard NI one I think) and sets the peak magnitude back to zero. This way, I am windowing the signal and measuring the maximum peak in every window. This is what I need to do.
    So I could use a logical filter to feed data to the running average only if;
    the amplitude of the signal is less than a certain threshold
    and if the current value has similar low peaks either side of it
    How would you construct the code to delay the evaluation so that the values in front and behind of the current data point can be analysed?
    thanks again
    Attachments:
    peak_find_screenshot.jpg ‏45 KB

  • How to change the frequency of pulse train on the fly using an array of values?

    Hi all!
    First I want to thank U for the great job you are doing for this forum.
    Iam still busy trying to control a stepper motor, by sending pulses from my E-series 6024 to a compumotor s6- stepper Driver. I've managed to get it working. I desperately need to control the motor using the values from an array. I believe we can use two approaches for that:
    1st - I can get an array of the "numbers of pulses". Each element must run for 10 milliseconds. Using that we can calculate the array of frequencies to send the number of pulses within 10 milliseconds for each specific element. Could we use the arrays of "number of pulses" and frequencies in a "finite pulse train " and up
    date with each element every 10 millisecond?
    2nd - Or Could we use of the frequency array in a "continuous pulse train vi" and update it every 10 milliseconds?
    Please note that I must use the values as they are.
    Can someone please built a good example for me? Your help will be appreciated.
    Regards
    Chris
    Attachments:
    number_of_steps.txt ‏17 KB
    frequency.txt ‏15 KB

    Tiano,
    I will try to better explain the paragraph on LabVIEW. The original paragraph reads ...
    "While in a loop for continuous pulse train generation, make two calls to Counter Set Attribute.vi to set the values for "pulse spec 1" (constant 14) and "pulse spec 2" (constant 15). Following these calls you would make a call to Counter Control.vi with the control code set to "switch cycle" (constant 7). The attached LabVIEW programs demonstrate this flow."
    You can make two calls to Counter Set Attribute or you can make a call to Set Pulse Specs which, if you open this VI, you will see that it is just making two calls to Counter Set Attribute. What you are doing with the Counter Set Attribute VIs is setting two registers called "pulse s
    pec 1" and "pulse spec 2". These two registers are used to configure the frequency and duty cycle of your output frequency.
    The example program which is attached to this Knowledge Base demonstrates how to change the frequency of a continuous generation on the fly. Why continuous? Because changing the frequency of a finite train would be easy. When the train completes it's finite generation you would just change the frequency and run a finite train again. You would not care about the time delay due to reconfiguration of the counter.
    If you would like to change the frequency of the pulse train using a knob, this functionality will have to be added in the while loop. The while loop will be continuously checking for the new value of the knob and using the knob value to set the pulse specs.
    LabVIEW is a language, and as with learning all new languages (spoken or programatic) there is a lot of learning to be accomplished. The great thing is that LabVIEW is much easier than mo
    st languages and the learning curve should be much smaller. Don't fret, you'll be an expert before you know it. Especially since you're tackling a challenging first project.
    Regards,
    Justin Britten

  • How to change the frequency of a finite pulse train?

    Hi all? I Know I’ve asked once a similar question, but I need a better answer. I would like some ideas or examples on how to modify the example in LV; "Finite Pulse Train Generation - Intermediate for AM9513-Based Devices",so that the frequency can be changed while the VI is executing.
    Will i have any problem with I use this VI in a DAQ-STC-Based Devices(E-series)?

    Tiano,
    I will try to better explain the paragraph on LabVIEW. The original paragraph reads ...
    "While in a loop for continuous pulse train generation, make two calls to Counter Set Attribute.vi to set the values for "pulse spec 1" (constant 14) and "pulse spec 2" (constant 15). Following these calls you would make a call to Counter Control.vi with the control code set to "switch cycle" (constant 7). The attached LabVIEW programs demonstrate this flow."
    You can make two calls to Counter Set Attribute or you can make a call to Set Pulse Specs which, if you open this VI, you will see that it is just making two calls to Counter Set Attribute. What you are doing with the Counter Set Attribute VIs is setting two registers called "pulse s
    pec 1" and "pulse spec 2". These two registers are used to configure the frequency and duty cycle of your output frequency.
    The example program which is attached to this Knowledge Base demonstrates how to change the frequency of a continuous generation on the fly. Why continuous? Because changing the frequency of a finite train would be easy. When the train completes it's finite generation you would just change the frequency and run a finite train again. You would not care about the time delay due to reconfiguration of the counter.
    If you would like to change the frequency of the pulse train using a knob, this functionality will have to be added in the while loop. The while loop will be continuously checking for the new value of the knob and using the knob value to set the pulse specs.
    LabVIEW is a language, and as with learning all new languages (spoken or programatic) there is a lot of learning to be accomplished. The great thing is that LabVIEW is much easier than mo
    st languages and the learning curve should be much smaller. Don't fret, you'll be an expert before you know it. Especially since you're tackling a challenging first project.
    Regards,
    Justin Britten

  • How do I make a VI to measure the frequency and power level of a transmitter using the NI 5660

    I am working on an RF project that requires me to measure and record the frequency and power level of a transmitted signal. I am using the NI 5660. I am quite new to Labview and the PXI, so I'm not so sure how to do this.
     I know I have to initialize the NI 5660 but I don't know what to do afterwards in terms of measuring the frequency of the acquired signal. I'm not sure what blocks to put together nor do I know where to find them. could someone please enlighten me on how I may understand what I need to do.

    Hi princess!     (it's funny writing that somehow)
    Have you considered the example finder?
    There should be examples on how to acquire and measure with the NI 5660.
    And there should be a block in LV that was delivered with the NI 5660 software, that does something like "acquire spectrum" or something like that.
    Regards,
    Pattos
    LabVIEW Gretchin

  • How do i measure the frequency of a sine wave using a field point counter module

    I need to measure the frequency of the sine wave using field point. is it possible and if yes how. do i need to convert the sine wave signal to square wave. Please let me know.

    It probably would be easiest to convert the sine wave to a square wave with a simple external circuit and then use a counter module to measure the frequency. There is a shipping example in LabVIEW that shows how to measure frequency with a FieldPoint Counter module.
    JRA

  • How can I measure the frequency of an analog signal?

    Hi,  I am trying to measure the frequency of VAC signal coming from a gas turbine engine at my university.  If I can get the values of frequency, I can determine the speed (RPM) of the engine.  I am fairly new to LabVIEW and I have been looking through manuals like crazy in order to find out how to obtain the frequency.  I have measured the signal with an oscilliscope and the highest frequecy will be about 1.5kHz.  I am currently using a USB-6218 and it can collect the voltage signal with ease, but it won't give be analog frequency so simply.  Can anyone explain a way for me to obtain the frequency values?  And if you could show or tell me in a very simple way (because I am not very fluent in LabVIEW yet), that would be amazing!  Thanks!

    Check this out:
    Attachments:
    RPM.vi ‏17 KB

  • How to measure the pulse duration of a TTL signal using AI?

    Hi there.
    I would like to know how to measure the pulse duration of a TTL signal using an Analog input.
    These TTL signals comes from an ultrasonic sensor's output. The pulse width of the signal is
    proportional to the distance of the object the sensor detected.
    I have tried using the example "Measure Pulse Width.vi" which uses a counter to measure the
    pulse duration instead. It provides me with correct results.
    However, i will like to know how can i do it using the AI instead.
    I tried it by using the example "Acq&Graph Voltage-Int Clk.vi" which i modified by including a
    timing and transistion measurement vi. Pulse duration was selected as the output. A graph indicator was also added at the output of the pulse duration to monitor the incoming TTL signals.
    However, everytime the TTL signals was detected on the graph indicator, the numeric indicator always produce a "zero" reading.
    I have attached my vi for your reference.
    Can anybody advice me what i have done wrongly?
    Regard.
    Attachments:
    Acq&Graph Voltage-Int Clkv1.vi ‏190 KB

    Hi Paul,
    Today i tried using 2 different methods to read the pulse duration of my sensor signal.
    Both methods use "Acq&Graph Voltage-IntClk" vi as a guide.
    Method1:
    Add a filter vi(lowpass/bandpass) and a timing and transition measurements vi.
    Pulse duration is selected as the output. With some numeric conversion, a centimeter
    reading indicator was created. However, the reading always remains as "zero"
    Method2:
    Add a Mask and Limit Testing vi and a timing and transition measurements vi.
    By adjusting my upper and lower limits, i manage to "filter" a single pulse out from the actual signal.
    However, like the earlier case, the cm reading still remains at "zero"
    I have attached both the methods resulted waveforms for your reference.
    Are there anything that you can advice on?
    Regard.
    Attachments:
    Results_Waveforms.doc ‏141 KB

  • I need to measure the frequency of a signal on Pin 39 (PFI 15) of a PXIe-6361 module.

    I need to measure the frequency of a signal on pin 39 (PFI 15) of a PXIe-6361 module.  All of the digital I/O pins are already assigned and in use.  The signal frequency range is 50KHz to 500KHz.  I have tried all of the sample programs for DAQmx Counter/Timer frequency measurement.  If I modify them to use my hardware, I get run-time errors with conflicts with resources already assigned.

    Hi Julia,
    Thanks for the response.  As I stated before, I have tried all of the examples available that apply.  There are only three and one of those uses two counters.  The two I have tried are:
      Examples/Hardware Input and Output/Counter Measurements/Digital Frequency/
          DigFreq-Buff-Cont-ExtClk-ArmStart.prj     and
          DigFreq-LowFreq1Ctr.prj
    These examples default to using what appears to be traditional DAQ hardware (Dev1/ctr0 and /Dev1/PFI0).  I changed the counter to mine (/PXI1Slot3/ctr3) and directed my signal source (PFI15 on pin 39) to the counter.  No matter what I tried would not run.  They would always compile but gave run-time errors ranging from resources already in use to “external trigger required”.  I have no external trigger source and, if I did, there is no indication of how to assign it to the counter.  NI has a very good X Series Users Manual that tells all of the great things you can do with the hardware, but there is NO CLUE how to do any of those things!!!!  I know that some NI DAQmx functions use hardware resources that they never tell you about.  I discovered that when trying to produce a single output pulse from a timer using counter #0.  (Which, by the way, no one at NI could tell me how to do it.)
    Measuring frequency should be very simple.  The unknown signal is routed through a precise gate to a counter, and then the counter is read.  NI DAQmx uses the opposite approach of using my signal as the gate and counting their internal source.  However, the examples would not let me use the internal reference sources.
    To answer your other questions, I am not performing any other measurements at the same time and the counter is not being used for anything else, period.
    Any help would be greatly appreciated.  Thanks again.
    Wayne K.

Maybe you are looking for

  • How to Schedule Java statistics job

    Hi All, We have a installed a NW07 Portal system on one of the unix boxes.Now we would like to run the oracle statistics on the same. Since there is no ABAP stack, we can't schedule the same thru db13. Is there anyway we can run the same. Can I confi

  • How can i connect and share files from my mac book pro to my windows PC?

    (I have a tp-link wifi router which is connected to mac and from the same router pc is connected via pan cable)

  • I Need Dire Help Making a Flash Form

    Hello, I need some serious help creating a Flash Form. I Have used a template from another site with the following input boxes: Name: __________ Email: __________ Comments: ____________ However, i had the script working fine, along with its php scrip

  • Acrobat 9.5.3 - very slow to open files

    Recently, opening a file with Acrobat has started an excruciatingly long time - sometimes as long as 30-60 seconds for a small file. What makes the problem even more frustrating is that files sometime open within a reasonable period of time. No, the

  • The sound on my HP Pavilion dv6 goes up and down randomly on its own

    Whenever I watch a YouTube video or play my iTunes music my sound goes up and down randomly by itself.  It is super annoying.  I just bought this laptop a month ago.  What is going on? Can I fix this or do I need to take it back?