Low-Frequency measurements using counter/timer

I am trying to measure speed, and am using the FP-502 counter timer module to count the pulses from my sensor. The field point example that uses a fixed width gate pulse will not work for my appliation because I need a gate pulse so big that it updates way to slow.
Does anybody have any sugestions on how to measure a low frequency signal using a counter/timer?
Thanks
Dan

Hello guys
Thanks for all your sugestions I have the final results. I got it to work but I would like to add some comments for anybody who is trying to attempt this.
Triggeing on the gate is a must for low frequency measurements. I used the divide by sugestion however using a factor of 3 only gets you about 60 Hz after that you can't sample fast enough. My application required me to measure from 0 to 150 Hz. I added a "gear shifter" routine where the terminal count was set to 3 on frequencies lower then 45 Hz and 15 for frequiencies greater than 45 Hz. Using a terminal count of 15 for all measurements made the udate rate on really low frequencies way to slow i.e. .5 seconds for 20Hz (check the math on this).
I a
lso needed to cascade the counters. At low frequencies the count went higher than 6550. Using the previos channel function of the fieldpoint module enable me to get 32 bit worth of terminal count data.
Finally I needed to add a timeout condition for 0 Hz. If there are no pulses coming from the senser the program displays the last value read. That won't be 0. So I added a time out routine that if I didn't see a pule in a certian amout of time, output 0 and reset the gate count.
Thank you for you help you relly saved me. I hope my comments made sense.
Dan

Similar Messages

  • Low Frequency Measurements using counter timers

    I am trying to measure multiple speeds using FP-CTR-502 modules.  I am having a resolution problem.  Looking at the post at the following URL (http://forums.ni.com/ni/board/message?board.id=110&message.id=3601&query.id=42252#M3601) looks like exactly what I need to do, but I'm not sure how to program this.  Does anyone have any example code to get me headed in the right direction?

    Hi Tcrower,
    Here is the example that Carl L. was describing in his forum post along with his instructions. Also, there are thorough instructions for using the program in the front panel as well as in File >> VI Properties >> Documentation.
    You can measure frequency in two ways using a counter.
    1) Measure the time it takes for a set number of pulses to pass or,
    2) Count the number of pulses that pass in a set amount of time.
    For low-frequency signals it is best to measure the time duration of a set number of pulses. If we tried to calculate the number of pulses that passed in a set amount of time, we would need a long gate period to get accurate results.
    The drawback of measuring the amount of time it takes for a set number of pulses to pass is that the sample period varies with the frequency of the signal.
    To accurately measure low frequencies with a CTR module, select two counter channels, one output channel, and one gate input channel. Count Input 0 counts the pulses of the signal that we are measuring. The output of the counter is set to high for x pulses and low for x pulses, which is used as the gate of Count Input 1. The source of Count Input 1 is the internal clock reference (the example can be modified to use an external clock reference). During the high phase of Count Input 0, Count Input 1 counts the pulses of the clock reference.
    During the low phase, we read channel 1 and reset the counter.
    For example, if the output of Count Input 0 is set to high for 4 pulses and the signal has a frequency of 20 Hz, the output of Count Input 0 is high for 200 ms. During the high phase, we will count 200 counts if we are using the 1 kHz internal clock reference. So to calculate the frequency, we have F = #pulses/duration = timebase * terminal count/counts = 1000 Hz * 4 terminal counts/200 counts = 20 Hz.
    Regards,
    Hal L.
    Attachments:
    Low_Frequency_Measurement_(CTR).zip ‏77 KB

  • 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  

  • Low frequency measurement (1 to 5 Hz) issues - Reg

    Hello All,
    i am facing a problem in measuring Low-Frequencies in the range of 1-5 Hz. I am using VIs used for pulse-width measurement and the card is PCI-6031E. i am generating frequency using PCI-6013 card.
    Actually i am trying to develop an application for measuring the speed (RPM) of the motor which runs very slowly. so if  i miss one pulse  per second also, when i multiply that with 60 it will be big error.
    So if any can give me a solution that will be big help to my issues.
    Thanks.

    Hello sathiskumar,
    I'm not sure what you mean by missing a pulse but I think what is
    happening is that your counter is rolling over and starting to count
    from zero again.  Every time the counter rolls over, it will
    output a pulse.  You can connect this signal to another counter
    and count how many times your first counter has rolled over.  That
    way, if you don't receive a pulse on your first counter before your
    counter rolls over, the second counter will have a record of how many
    times this has happened.
    I hope this helps!
    Eric
    DE For Life!

  • Use timing measured using counter 1 to set the pulse width on counter 2

    I am measuring time between 2 edges on counter 1.  I want to be able to generate a pulse on counter 2 that is dependent on the time measured by counter 1.  The delay on counter 2 is a multiplicative of the time measured on counter 1. Is this even possible?

    Hi Thaison V,
    I am using a PCI 6251 M series card and using DAQMX.  Your assumptions are alomost correct.  I am using a period measurement to measure time in between two leading edges on counter 1 inside a while loop.  I had set up the second counter to generate a single pulse on each trigger (retriggerable digital trigger) inside the same loop and update the low time of the pulse using the channel property.  There seems to be a 2 iteration delay between when counter 2 catches up with time measured on counter 1 time.  I believe this is because the pulse is already generated before the vaule is measured on counter 1.  I suppose if I can use counter write after the counter 1 is read out it might work, but I haven't figured out how to use DAQMX write to write a single pulse ( it works only for pulse train??).
    thanks for your help
    V

  • 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

  • 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.

  • How to use Counter/timer PWM Pulse as a trigger to aquire data??

    (1) I'm using the NI DAQpad 6015 multi-function card with the new DAQmx Driver. I'm using the counter/timer (counter 0, and counter 1) to generate 2 different PWM pulses to supply my sensor circuit. each pulse is a 1 second in duration. The pulse with 5m.sec duty cycle is the supply for my sensor. In addition to that, I'd like to use the 5 m.sec as a trigger to aquire the sensor reading. The DETECTIN POINT should be the middle of the HIGH State of the 5m.sec pulse (i.e just at the 2.5 m.sec point of the high state).  
    (2) another point is: how to display the counter/timer pwm output pulses on the front pannel?? 
    Attached is the VI i'm using (Complete PWM.vi)
    regards,
    Attachments:
    Complete PWM.vi ‏49 KB

    Hello alaali,
    It sounds like what you need is a trigger delay property node.  This property node specifies an amount of time to wait after the Start Trigger is received before acquiring or generating the first sample. This value is in the units you specify with Start.DelayUnits.  This way you can still acquire using the trigger, and you can specify the delay to be 2.5 ms so that the point that you actually acquire will be 2.5 ms after the trigger.
    Hope this helps.
    Regards,Message Edited by Raajit L on 04-23-2007 04:34 PM
    Raajit L
    National Instruments
    Attachments:
    DAQmx Trigger Delay.jpg ‏6 KB

  • Low velocity measurement using 6601

    I am using 6601 on measurement of position and velocity of increamental encoder. Our sevor motor rotate at very low speed. How can I measure the velocity at high accuracy at the same time of measuring the posstion of encoder.Can you provide me some tip? Thanks.

    Hello;
    You can use two counters to accomplish that task.
    The first counter can be used and configured as position measurement. That will make the counter to give back the position of the motor.
    The second counter can be used as buffered event counter. You just need to route one of the encoder channels to the counter gate, and since you know the frequency of the source, and at every event of a gate pulse, the internal value of the counter is transfered to the buffer, you can do a quick calculation with the number retrieved and the source signal frequency.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • Frequency Measurment using Compact DAQ Chassis PFI Input

    I have an 8-slot compactDAQ chassis, cDAQ-9178.
    I am using Windows/CVI version 8.5 with DAQmx version 9.3 drivers.
    I would like to use one of the PFI channels that are provided on this chassis [0/1] to measure a TTL level signal whose frequency is approximately 1KHZ.  When I try re-routing or specifiying the PFI channel, using DAQmx functions, as the counter source DAQmx reports a resource conflict.
    Can this be done?
    According to MAX 4.8 it appears that the PFI0/1 signals can be routed to any of the STPC3 counter inputs.  What functions do I use to accomplich this? 
    Solved!
    Go to Solution.

    Hi Rgulbrandson,
    The counter frequency input terminal is set by a task-based route. To control the source of that route, call DAQmxSetCIFreqTerm(myTask, "", "/cDAQ1/PFI0") before committing/starting the task. Immediate routing functions like DAQmxConnectTerms() can't override task-based input routes, which might have caused the resource conflict you saw. However, without seeing the actual error message I can only guess. If DAQmxSetCIFreqTerm() doesn't help, could you post the error message and a snippet of your code?
    Brad
    Brad Keryan
    NI R&D

  • Frequency measurement using multisim

    Hi all
    i'm new to multisim and i want to ask about how can we measure frequency of analog signal(ecg) using multisim oscilloscope
    I will be waiting for you reply
    thnx 

    Hi Rahul,
    OK, for a bandpass filter, you should use the AC Analysis under the Simulate menu. Another method is to drag a Bode Plotter and connect it to your circuit.
    For the AC Analysis of the filter respnse, this following link might help you.
    Configuring an AC Analysis in Multisim
    http://www.ni.com/white-paper/12690/en/
    NI Multisim: AC Analysis frequency response
    http://www.youtube.com/watch?v=tgCPDBtRcso
    If using  the Bode Plotter,
    MultiSim Bode Plotter
    http://www.circuitsmadeeasy.com/index.php?option=com_content&task=view&id=105&Itemid=74
    Regards,
    Chen_T
    National Instruments
    Attachments:
    14Pin_Chip.ms13 ‏87 KB

  • Accurate frequency measurement using PXI 5142 Digitizer

    I am Using PXI 5142 Digitizer to read the frequency of a 10 MHz atomic clock up to 8 decimal places. I am using single tone measurement block. But I can't get that accurate fix on the frequency because of the jitter.
    Can someone help.
    Thanks in Advance.

    Thanks For your reply; The device is connected to the digitizer through BNC connector.
    Digitzer Scope Settings:  
    Samples/seconds --> 2G S/s
    Record Length      --> 800
    Aqiusition mode   ---> N Samples              
    Best Regards,
    Helal
    Attachments:
    Block Diagram.JPG ‏117 KB
    Front Panel.JPG ‏91 KB

  • Semi-additive measure using specified time dimension

    Hi,
    I am trying to make a semi-additive measure which will represent an Order Intake calculation.  Please see the data below:
    I plan on taking a copy of my Open Orders (Order Book) on the 1st of each month.  This gives me the ability to show that for example order A was entered in january, but at some point during the month it was increased by a value of 5.  So if I use
    Order_No and Value i see the following - which is good:
    ORDER NO
    Value
    A
    15
    B
    20
    C
    25
    D
    10
    Using snapshot_date as below, is good:
    Date
    Value
    2014-01-01
    30
    2014-02-01
    50
    However, using Brand i see the following:
    Brand
    Value
    X
    15
    Y
    35
    What I don't understand is why the value in X is wrong, but Y is right?  I am expecting the sum of the different orders within the brand, but the latest value by snapshot date.
    The "Value" is using the AggregateFunction "LastNonEmpty".
    I hope this example makes sense and look forward to some responses!
    Thanks

    Hi Dom,
    Does
    Yogisha's suggestion work on your scenario? If the issue persists, please post the detail information about your issue, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • High frequency measurement 2 counters range

    Hello,
    I know this info is somewhere but I can't find it.
    When using a Counter/timer to measure frequency there are multiple methods.
    i.e. Low Frequency with 1 counter and high frequency with 2 counters.
    What is the definition of a "low frequency" and what is the definition of a "high frequency"?  i.e. low frequency = frequencies below 100 Hz 
    Also what is the definition of a "large range"?
    Thanks
    Dan

    Hi Dan
    There isn't a specific bandwidth that is defined for use with either the one-counter or two-counter method. However, located in the NI-DAQmx help file there is a section detailing the quantization errors that arise when using either method with a variety of input frequencies. By referring to this information you should be able to determine which method will produce the smallest error in your application and hence which method will be preferable. This help file also explains the errors associated with the large-range two-counter method.
    To locate the help file, you should select Start»All Programs»National Instruments»NI-DAQ»NI-DAQmx Help, and search for 'quantization error'.
    I hope this helps, just let me know if you'd like anything clarified or if you have any other questions on the matter.
    Regards
    Jeremy T
    Technical Marketing Engineer
    National Instruments UK & Ireland

  • 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

Maybe you are looking for