Continuous frequency measurement~

Dear sir,
    How are you today?
    I tried to program the "Measure Frequency.vi" in LabView 5.1 .  I've the simplified version
from "LabView Measurements Manual" in page 10-26. Basically, we want to measure the
frequency change within 20 ms (chirp). So I just naively added the "for loop" enclosing everything,
as the attached VI. But the testing result (please see the attached document) showed that
sometimes the counter/timer (AM9513) lost count. Could you please troubleshoot my VI and
tell me how I should improve?
    In addition, I tried to use the oscilloscope to see the gate signal from counter-1 (counter 5)
OUT pin, but it showed 0.14V. The signal from GATE pin of counter (counter 1) showed 5V.
I was expecting what I would see is something like TTL signals with different pulse widths and
delay widths. Can you tell me what I was doing wrong?
    Thank you for your previous answers!
Best regards,
Margaret
Attachments:
Continuous Measure Frequency1.1.vi ‏122 KB
continuous frequency measurement.doc ‏168 KB

Hi Margaret,
I think that there is one way to obtain a count every 20ms. What you will need to do is:
1. Generate a 50 Hz pulse train
2. Connect your signal to the a counter source
3. Connect the 50 Hz pulse train to the counter gate
4. You will obtain a series of counts over a 20ms period and you will be able to determine the frequency of the signal using post processing by dividing the count # by 0.02.
I noticed that you are using LabVIEW 5.1. This version of LabVIEW is no longer supported. I highly recommend upgrading to a newer version of LabVIEW. This will allow you to program with the DAQmx driver and creating your application with this driver would be significantly simpler and take a lot less time.
If you do not want to try this method, then I am attaching the screenshot for measuring the time the while loop takes to execute. I want you to know that the overall time will not have an effect measuring the signal's frequency. There really isn't anything you can do to decrease the execution time for the counter. I hope that you find this information helpful.
Regards,
Hal L.
Attachments:
While Loop Timing.gif ‏12 KB

Similar Messages

  • New M Series DDK Example: High Frequency Measurement with 2 Counters

    This example demonstrates how to configure two counters on an M Series device to measure a high digital frequency. One counter generates a continuous pulse train of a set frequency while the other counts the external signal using the pulse train to latch values. Data is transferred via DMA.
    Use this example to add high digital frequency measurements or DMA data transfer for counter input to your driver.
    Please let me know if you have questions or problems. Thanks :-)
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)
    Attachments:
    gpctex5.cpp.gz ‏4 KB

    You should connect the signal (whose frequency needs to be measured) to Ctr-1, and there gonna be an internal connection between the output of the first counter and the gate of the second counter (as described here).
    You may want to check this link as well.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Simultaneo​us frequency measuring

    I have to measure for frequency signals simultaneously, so that I'm able to associate one measured value to the others. How do I synchronize this? Is this possible with the four counters on a 6601 board? Two of the signals have frequencies up to 15 KHz, two of them go up around 4kHz. I also have a 6014 board with an additional counter available, maybe I could use it somehow...I also have to synchronize the analog acquisition that I perform with the 6014 with the one of the frequency signals, namely a continuous TTL pulse.
    Thanks in advance for any help!

    It sounds like there are two major parts of your application that you need to work on (1) synchronizing your counter operations and (2) synchronizing your analog input (AI).
    Since you need to perform four frequency measurements, the easiest way to get the counters synchronized is to supply a common gate and trigger to all four counters so that they start together and all acquire their frequency measurements off of the same input clock/pulse-train. I have attached an application note that discusses a lot of the factors that you need to consider and how to perform multicounter synchronization. Also the following link also gives some more information on triggering multiple counters with a single pulse:
    http://digital.ni.com/public.nsf/websearch/CE99A0B​2A
    9048A2A86256C630062F550?OpenDocument
    Along with this, you mentioned wanting to synchronize your analog acquisition with one of the frequencies. I am assuming that this means you want to trigger your analog acquisition based on one of your four frequency signals. I am not completely clear on what your application needs to do here so I would look at what you have and at some of the information online and the shipping examples to see if you can find a good example to show you what you need to do in this case. If you need to set up a retriggerable AI, then remember that your hardware is not retriggerable; however, you can emulate this in software, which can be slow since it is not that efficient and is very system dependent, or you can use two counters to create a continuous pulse train.
    Regards,
    Michael
    Application Engineer
    National Instruments
    Attachments:
    Multicounter_Synchronization_App_Note.doc ‏52 KB

  • Simultaneous frequency measuring

    I have to measure for frequency signals simultaneously, so that I'm able to associate one measured value to the others. How do I synchronize this? Is this possible with the four counters on a 6601 board? Two of the signals have frequencies up to 15 KHz, two of them go up around 4kHz. I also have a 6014 board with an additional counter available, maybe I could use it somehow...I also have to synchronize the analog acquisition that I perform with the 6014 with the one of the frequency signals, namely a continuous TTL pulse.
    Thanks in advance for any help!

    Hi Achim,
    Typically, frequency measurements are made using two counters for increased accuracy. However, you can measure frequency using 1 counter and taking the inverse of the period measurement. You would just need to apply this to 4 counters. There should be a shipping example with the NI-DAQ driver that performs this. Here is a link to an excellent tutorial on frequency measurement.
    Making Accurate Frequency Measurements
    http://zone.ni.com/devzone/conceptd.nsf/webmain/CD2C8AAED8FA59A486256C230078FE75?opendocument
    This being said, what I suggest in your case is to use a 6602 counter/timer board with 8 counters, 2 for each frequency measurement. Using a 660x board, you can also use triggering to simultaneously start all counters. This can be
    done by routing a signal from the PFI line to the counter trigger using Route Signal.vi in LabVIEW or Select_Signal() in C function calls. Then you would setup a trigger and reference the common trigger signal that you routed the PFI line to. The following discussion thread might be useful:
    Counter/Timer Triggering 660x
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=506500000008000000B2300000&ECategory=Measurement+Hardware.Counter%2FTimer
    Anyway, I hope that helps. Have a good day.
    Ron

  • Compact daq frequency measurement

    hello,
    I am considering using the compact DAQ NI cDAQ-9172 for my measurement and I want it to acquire frequency measurement. I have some analogue input, they are signal with noise. (A example is a measurement of a magnetic pick up)
    I want to have a counter, I wuold use  the internal counter (5 / 6 slot) of the chassis ) NI cDAQ-917.
    I am considering using the NI 9201, but I can utilize the internal counter with a analogue input module?
    THANKS!!!!!!!!!!!!
     chiara.

    thanks for your reply.  maybe i explained my situation incorrectly.
    From the that sample freq program you showed me, i'm just using the numberic indicator for frequency only and not the other graphical displays (like the voltage and frequency spectrum).
    In my original program, i already have a bunch of graphical displays measuring physical channel ai8 to ai12.
    I wanted to see what frequency my ai12 channel as well as measure/display the voltage graphically.  I believe your saying that i can't measure both frequency and graphing at the same time on 1 channel?
    What i did was I connect ai12 channel to ai13 and basically copied the the sample freq measure vi program to my original program to indicate frequency.
    my orignal program has set the DAQmx reading ai8:ai12  to a analog 2D DBL multiple sampling.
    but i noticed that the sample frequency measure program requires the DAXmx read.vi set to 1D waveform to measure frequency not 2D DBL like the rest of my program.  I think it is where this part i'm having problems with sampling all my inputs ai8 to ai13.
    so when i copied the sample frequency measure program into my original program, it only runs one physical channel. Only the sample frequency program (ai13) or my other ai8 to ai12 graphs will work but not both at the same time.  It can't do all ai8:ai12 2D including the ai13 1D measurement continuously.
    i dont think its possible to read in analog 1D and 2D measurements at the same time?
    Thanks again.
    Message Edited by immortalc on 01-04-2008 10:02 AM

  • DAQmxCfgIm​plicitTimi​ng vs frequency measure accuracy

    Hi,
    I am trying to measure the frequency of a digital input. Its duty cycle varies a little but the total width of 18 pulses is always fixed. I tried to follow the example of "Dig Freq-Low Freq 1 Ctr" but it seemed the width of 18 pulses varied obviouly which is wrong. Then I tried another example "Buff Semi-Period-Finite" and this time the result was correct. I compared the two examples and found that the main difference is there is DAQmxCfgImplicitTiming func in the latter example. Then I added DAQmxCfgImplicitTiming to the "Dig Freq-Low Freq 1 Ctr" and now it works correctly. So my question is what DAQmxCfgImplicitTiming is for? How come it can improve frequency measure accuracy? Please give me some details instead of the simple instruction in the C reference help.
    Thanks.
    David

    David,
    I aplogize if my previous posts have been confusing, but here is how you should be configuring your DAQmx tasks:
    - you should use implicit timing when doing any buffered counter measurement: so this includes a continuous or finite acquisition of counter measurements
    - as such if you are performing a single 1 sample acquisition of data on the counters, you should not use implicit timing as it does not perform the timing measurement accurately (the counter does not start counting at the correct point)
    - the DAQmxReadCounterScalarF64 function and DAQmxReadCounterF64 functions don't have an effect on the timing. You can use either depending on whether you are doing buffered measurement or not
    - the difference between these two functions is that the ScalarF64 function returns the raw tick count for a frequency or period measurement. This is the count the counter returns when comparing your signal to the 20Mhz timebase. The other function makes the transformation from raw tick count to an actual frequency or period measurement (in Hz or seconds)
    I hope this clears things up,
    Abhinav
    Abhinav T.
    Applications Engineering
    National Instruments India
    LabVIEW Introduction Course - Six Hours
    Getting Started with NI-DAQmx
    Measurement Fundamentals

  • How can we substitute the invalid option "reset after read" in FP-CTR-500 + FP-1600 frequency measurement application?

    We nned to incorpore the values of 2 frequency signals (0-10 Khz)into a process controlled by a VisualBasic application running on 1 PC with W'95. Because the FP-CTR-500 working with FP-1600 hasn't the option "reset after read", the process of reading is a bit complicate, and sometimes, we receive wrong values of frequency from those devices. Could you help me? Is there any extremely reliable method of reading? Best regards,
    Puho

    For frequency measurement information on the FP-CTR-500/502 modules. Please see KnowledgeBase Article #1TB63SUS
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/d8db42f9fdc3607e862568640047f144?OpenDocument
    Ultimately, the FP-CTR-500/502 modules are not designed for frequency measurement, although it is possible to use them to measure frequency. The one thing is that it works best to do the measurements over relatively long integration periods (1/4 second or more).
    Regards,
    Aaron

  • How to use a photogate for frequency measurement using a NI USB-6211

    Hello, I am extremely new to LabView and am having trouble using the counter feature (or if this is even what I should be doing). I am trying to use a photogate as a frequency counter when a voltage spike is created by blocking the sensor. This will then be put into RPM and used to evaluate a small motor dyno I am creating. If anyone has any help or previous vi's they dont mind sharing it would be greatly appreciated. The photogate specifications are for an optek opb930l55. Thanks 

    Configuring a counter input task will be a little different depending on the type of DAQ card that you are using to read the digital pulses.  You just need to wire the voltage from the photogate to one of the counter pins on the card.  Then follow one of the many examples for measuring the frequency of pulses.  If your card allows it, I would suggest choosing the Counter Input >> Frequency measurement from the DAQmx Create Channel VI.  If you have questions about how to do this with your specific DAQ device, please provide more information
    Zach C.
    Field Engineer
    Greater Los Angeles

  • PXI-6624 Pulse Frequency measurement

    Hi.  I'm working with a PXI-6624 and am interested in doing pulse frequency measurements to get both frequency and duty cycle on its inputs using DAQmx.  
    Whenever I go to create the virtual channel however, I get error -200431:
    "Selected physical channel does not support the measurement type required by the virtual channel you are creating."
    "Requested Value: Pulse Frequency"
    "You Can Select: Frequency, Period, Pulse Width, Semi Period, Two Edge Seperation, Position:..."
    Is this card really not capable of doing these pulse frequency measurements?  
    Solved!
    Go to Solution.

    Yes, the "Pulse" (not to be confused with "Pulse Width") measurement was introduced with NI's STC3 devices including X Series and CompactDAQ.  
    Pulse Measurement:
    However, you should still be able to measure frequency and duty cycle on your card with a semi-period measurement:
    Semi-Period Measurement:
    Images are from the X Series User Manual.
    The difference between the two modes comes down to how the data is stored and buffered on the card--with the semi-period method the hardware doesn't distinguish between high and low samples and puts everything into a single buffer.  However, if you start the counter off the appropriate edge (see below property node), then you would know in software the order of high and low samples and can pretty easily calculate frequency and duty cycle from this.
    Best Regards,
    John Passiak

  • DAQ frequency measurement using anolog input channel

    Hello,
    I try to develop a DAQ application which run on a real time target.
    I want to measure frequency using anolo inpur channel of my DAQ card. I have a problem.
    Let me first try to explain what i trying to do. In the first loop i do sampling and show the result as double array.
    I need to show samples as double array so i can not read sample as waveform. With a shared variable i sent these samples to second loop.
    First loop reriod is msec and second loops period is 20 msec.So when the second loop run, 20 samples were alraady ready, frequency measurement is done.
    The problem is that i need to show frequency measurement as far as possible. Say frequency of my signal is about 100 hz, then this
    configuration gives correct frequency measurement. But if frequency of the signal is about 10 hz, this configuration fails since period of second loop is 10 msec and it is not enough time to measure a 10 hz signal. But if i adjust period of the second loop as 100msec,
    then i can measure 10 hz signal but then i can give measurement of a 100 hz signal  +90msec late. What can i do so i can measure frequency af signals ranges 0-100hz and give measurement result as far as possible?
    Attachments:
    measure_amp_freq.GIF ‏35 KB

    eesen,
    What you are doing doesn't make any sense to me. First of all, you should take multiple samples with the DAQmx Read and not one sample at time with the timed loop. Your frequency measurement will then actually be more accurate. You also should return a waveform. That includes timing information that the Freq & Amp function needs to determine the frequency. It cannot do it with a dbl array. If you have to display a dbl, then just use the Get Waveform Components to extract the y array. You can get rid of the second timed loop and use a regular loop for the DAQmx Read. If you just set the rate to be twice the highest input frequency and acquire enough samples for a couple of cycles, you should have a pretty accurate reading.

  • Frequency measurement using Labview 8 and Fieldpoint FP-CTR-502 - wind speed measure

    All the information regarding this kind of application seems to be outdated, I did not find no solution or example to construct frequency measurement VIs using Labview 8
    The examples at "NI Discussion Forums :
    Most Active Hardware Boards :
    FieldPoint Family :
    Low-Frequency measurements using counter/timer" is very strange and so far the steps given seems to be usefull only do old Fieldpoint Explorer.
    I was trying to find a way to learn how to make an anemometer send its signal to a FP-CTR-502 but I have no sucess.
    I am realy very new on this Labview stuff, any help would be welcome.

    (similar thread here)
    Message Edité par Mathieu R. le 12-23-2005 02:28 PM
    .mrLeft{float:left} .mrInfo{border-left:solid 1px #989898;font-size:x-small;color:#989898}
    Mathieu R.  
      CTD - Certified TestStand Developer / Développeur TestStand Certifié  
      CLAD - Certified LabVIEW Associate Developer  

  • FP-CTR-500 and Frequency Measurement: How to modify it to report the frequency (0-10 Hz) every one minute?

    How to modify "Frequency Measurement" to report the frequency every one minute?  
    The signal frequencies vary from 0 to 10 Hz (see the analog output plot and attached sample data file), so I want record the average frequency every one minute. 
    Software: Labview 8.5 
    Hardware: FP-CTR-500
    Program: "Frequency Measurement"  --build in and under "NI example finder", It was attached with this message. 
    Physical wiring: (1) The signal I want to measure to count input 1 (pins 2 and 18).  it is a pulse signal (range from 0 to 1 V, see the plot and attached data file). 
     (2) Wire Output 0 (pin 130 to gate 0 (pin 9).   Do com pins 26 and 30 need to wire together? 
    FP-CTR-5000 was set up in Max based on the program instructions. I have tried different gating pulse frequency, my readings are always "0". 
    Attachments:
    H2O_20130809.xlsx ‏18 KB
    Frequency Measurement.vi ‏35 KB

    CTR-500 high pulse is >=10V. Hence, it always read your pulse as low. With this low voltage pulse, you must use analog input module, and write a program to read pulse from analog level. You must also make sure that you pulse is not so narrow that cFP loop is not fast enough to capture voltage change.

  • Digital frequency measurement speed in labview

    I am using a USB 6210 device to measure low frequencies of 50 to 1000 Hz. I need to log the frequency every 50ms. I do this in a while loop in labview using a 1 counter low frequency measurement in labview and saving the data using express VI.Each iteration of the loop takes atleast 60 to 100 ms just to read the frequency inside the loop. How do i increase the speed of measurement in Labview ?
    Solved!
    Go to Solution.

    PraveenB,
    Here is a table of the Counter terminals and related PFI lines.  This can be found in the NI DAQmx Help. (http://digital.ni.com/public.nsf/allkb/CCDFC93878BD8781862570FC00559980?OpenDocument)
    Default NI-DAQmx Counter Terminals
    Counter/Timer Signal
    Default Pin Number
    Signal Name
    CTR 0 SRC
    1
    PFI 0
    CTR 0 GATE
    2
    PFI 1
    CTR 0 AUX
    1
    PFI 0
    CTR 0 OUT
    6
    PFI 4
    CTR 0 A
    1
    PFI 0
    CTR 0 Z
    3
    PFI 2
    CTR 0 B
    2
    PFI 1
    CTR 1 SRC
    4
    PFI 3
    CTR 1 GATE
    3
    PFI 2
    CTR 1 AUX
    4
    PFI 3
    CTR 1 OUT
    7
    PFI 5
    CTR 1 A
    4
    PFI 3
    CTR 1 Z
    2
    PFI 1
    CTR 1 B
    3
    PFI 2
    FREQ OUT
    8
    PFI 6
    When you choose counter 1 in the Create channel VI it automatically reserves the gate which is PFI2.  If you use Counter 0 then PFI 2 will work fine.  Likewise if you use Counter 1 you can use anything but PFI 2.
    Message Edited by Jason_D on 10-24-2008 11:43 AM
    Sincerely,
    Jason Daming
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • DAQmx Error 89137 When trying to make a high frequency measurement.

    I am using a PCI-6602 Timer/Counter for multiple measurements on a serial interface...
    I have the clock line connected to Gate0, the enable line to Aux0 because I need to make a two-Edge seperation measurement between the two later...
    But I also want to make a "Period/Frequency Measurement (High Frequency with Two Counters)" measurement...
    This requires that the signal to be measured is on Source0...
    I implimented the following Code:
    void meas_FP_Freq(float64 *Freq0, float64 *Freq1)
    TaskHandle CLK0_Freq, CLK1_Freq;
    DAQmxCreateTask ("FP_CLK0_Freq", &CLK0_Freq);
    DAQmxCreateTask ("FP_CLK1_Freq", &CLK1_Freq);
    DAQmxConnectTerms ("/Dev3/PFI38", "/Dev3/Ctr0Source", DAQmx_Val_DoNotInvertPolarity); // Gate0 to Source0, No Error....
    DAQmxConnectTerms ("/Dev3/80MHzTimebase", "/Dev3/Ctr1Source", DAQmx_Val_DoNotInvertPolarity);
    DAQmxCreateCIFreqChan (CLK0_Freq, "Dev3/ctr0", "", 6000000, 6500000, DAQmx_Val_Hz, DAQmx_Val_Rising, DAQmx_Val_HighFreq2Ctr, 0.001, 4, "");  // High freq measurement
    DAQmxCreateCIFreqChan (CLK1_Freq, "Dev3/ctr1", "", 6000000, 6500000, DAQmx_Val_Hz, DAQmx_Val_Rising, DAQmx_Val_LowFreq1Ctr, 0.001, 4, "");
    DAQmxReadCounterScalarF64 (CLK0_Freq, 3.0, Freq0, 0); // Run-Time Error -89137 Specified Route cannot be satisfied..etc
    DAQmxReadCounterScalarF64 (CLK1_Freq, 3.0, Freq1, 0);
    DAQmxDisconnectTerms ("/Dev3/80MHzTimebase", "/Dev3/Ctr0Source");
    DAQmxDisconnectTerms ("/Dev3/80MHzTimebase", "/Dev3/Ctr1Source");
    DAQmxClearTask (CLK0_Freq);
    DAQmxClearTask (CLK1_Freq);
    The "Low Frequency" method works fine, but the resolution is too low...
    Every help file I've read indicates I can use different PFI inputs for measurements... What am I missing?

    Hi,
    The reason that you are getting the error is the PFI lines are being reserved twice. You don't need the DAQmx Connect Terms functions in your code because the DAQmx driver does this for you automatically. If you still receive an error after doing this, try to changing the low frequency counter number.  I hope this helps you with your application.
    Regards,
    Hal L.

  • Scxi 1126 frequency measurement along with other scxi modules

    I want to measure frequency signal using sxci 1126. I have gone through the example code for sxci 1126. I am using NI-DAQ and Labview 7.1.
    The example code is applicable when am acquiring only from 1126. I have to acquire data also from 1102 102B along with 1126.
    In the example code along with AI config.vi and Ai Start.vi there are two additional vi's like AI paramete.vi and AI Trigger config.vi I understand that they are used for reading from 1126. My worry is how this is going to affect my acquisition from other scxi modules as all the modules are in multiplexed mode.

    Hi Bipin,
    Looking at your code, I see that you are still using Traditional DAQ. Since you have LV 7.1, you can take advantage of the new features of DAQmx.
    With DAQmx, you can create a virtual task that includes all of the different types of measurements you want to make. Once you set up the task in MAX, you can place it on the block diagram and automatically generate the code necessary to execute this.
    To do this, open up the Measurement and Automation Exlporer (MAX). Select "Data Neighborhood" from the tree on the left. Then click the button labeled "Create New." Create a DAQmx Virtual Channel. Follow the series of menus to set up your first type of acquisition (1126 frequency measurement). When you are
    done creating the task, you can add the second type of measurement to that same task. In the task config page, you will see a white box with the name of the channel you just created in it. Above the name you will see an "Add" button. Click on this button and follow the menus to set up your second measurement (1102 module).
    Once they are set up, save the task and open LabVIEW. Place the DAQmx Task Name constant on your block diagram found in All Functions >> Data Acquisition >> DAQmx... the task name constant is a purple colored box. Clicking on the box once its on the block diagram will expand a menu that will let you choose your task. Once selected, right click on the task name and choose Generate Code >> Example. This will automatically generate the code necessary to run the tasks. Simply hit the run button and enjoy!
    Thanks,
    Sal

Maybe you are looking for

  • Current Month vs. YTD

    I am wanting to show account balances for the Current Month vs. Year to Date. I am using a BSO cube and have heard that Dynamic Time Series don't work in OBIEE, which is where we're going to be building reports off this data. We want this calculation

  • LACK of Apple Support!!!! (iTunes help)

    I have 2 computers I've tried to upgrade my iTunes for. Both failed and now I don't have any operational iTunes program available. Which means, I can't update my iPod with new songs as iTunes does not work on either computer. One computer reads: "Inv

  • Move URLs in Text to End of Story Or Link Text. Also: Tables

    Hello everyone I'm currently working on a script that translates Textile Markup into formatted InDesign-Text. This worked fine for the most part, seeing as it's not really hard to do by FindChangeByList. Some things are a bit trickier than other thin

  • IT 0023 - Other/Previous Employer

    Hey, How to get a report of Other/Previous Employer infotype?? Regards, Saket

  • CS4 marquee and paint bucket too sensitive

    Hi, I've just upgraded from CS3 and straight away ive tried using the paint bucket, colouring a black and white image. When I either use the paint bucket or the marquee tool to select the white area inside the black lines, it randomly selects areas o