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.

Similar Messages

  • 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  

  • 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

  • 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

  • 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

  • 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

  • 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

  • Can any NI/Labview DAQ hardware be used to input video? BNC, S-Video, RCA, etc?

    Hello,
    I am trying to manipulate digital video captured from security-type cameras and other devices.  I am just beginning on this adventure and would like to know if the National Instruments Suite has some possible solution.
    Thanks!
    M. Logan

    Sure!  NI has a series of image acquisition products just for this.  Check out this link and I think the best one is the NI-1411.
    http://www.ni.com/vision/hardware.htm 
    Hope that this helps,
    Bob Young
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • 6602: How to use 8 counters simultaneously in C++ using traditional Daq for frequency measurement

    Hi Everybody;
    I'm new to Ni-DAQ cards and working on NI PCI-6602 Card in Borland C++, I should use Traditional DAQ for my project. Now I want to use all the 8 counters simultaneously for frequency measurement.
    1.Where should I connect my External signal, to source or gate, at present I have connected to source.
    2. How to set parameters and start the counters simultaneously, what are the parameters to be set for frequency measurement.
    3.How to start counting.(parameter settings)
    4.Should I set any PFI Lines or by default are they set to counters.
    status = GPCTR_Set_Application (1, gpctrNum, ND_SIMPLE_EVENT_CNT)
    status = GPCTR_Change_Parameter (1, gpctrNum, paramID, paramValue)
    iStatus = GPCTR_Watch(1, gpctrNum, ND_ARMED, entityValue);
    status = GPCTR_Watch (deviceNumber, gpctrNum,ND_COUNT, entityValue)
    what is the paramID in my case, Clear and appropriate answers would be very helpful and thanks in advance.
    Message Edited by Pavan K on 07-11-2009 12:38 AM

      I have made a program with LabVIEW 5.1 based on NI 6602, in which four counters were used.
      Counter 3 is used to generate pulses, which are directed to the gates of counter 0, 1 and 2. 
      The source terminals of counter 0,1 and 2 receive pulses, individually, to count how many pulses appear during the time interval of each gate pulse.
      The results are stored in a data file.
      In order to test its performance, only one signal of ramdom pulses is sent to counter 0,1 and 2.
      But I find that at the beginning the counts for the three counters are the same, but the following counts are totally different!
      What's wrong? And how to solve such a problem? Does it have something related with synchronization?
      Thank you very much!

  • Sampling frequency when using USB6251 for SemiPeriod measurement

    Hi there.
    I am using the USB-6251 for frequency measurement. I use C# and the latest 8.5 drivers for .Net 3.5.
    My question is this:
    I have CounterInputChannel with MeasurementType=SemiPeriod.
    The TimeBaseSource is "80MHzTImebase" and Prescaler is 1.
    The reported minimum (CICHannel.Minimum property) is 25ns - 40MHz
    I am measuring frequency on a 32.768kHz crystal which should be pretty stable and accurate. The measurements suggest that the samplerate is actually 20MHz, not 40MHz. This also makes sense, because if I try to create a frequency measurement, I am forced to use a divisor of 4 or more - which gives a sampling rate of 20MHz.
    So my question is this: Is the reported minimum as read from CIChannel.Miminum wrong?

    Additional info,
    I downloaded and ran the DAQ diagnostic Utility v1.0 and got the following results, see below
    Regards,
    runson
    9/16/2005 6:54:58 PM
    Results saved to:  C:\Documents and Settings\Runson\My Documents\Diagnostic Results.txt
    Selected Device: Dev1
    Device Type: PCI-6250
    Serial Number: DE4115
    Device Support: (PASS)
    NI-DAQmx Version: 7.5 (PASS)
    Device Reset: (PASS)
    The device was last self-calibrated on: 9/15/2004 5:04:09 PM
    Running Calibration ...   (PASS)
    -------------------- Testing Counters... --------------------
    Testing CTR Buffered Pulse Generation...   (PASS)
    Testing CTR Single Pulse Generation...   (PASS)
    -------------------- Testing Analog Input... --------------------
    Testing AI Ground Reference...   (PASS)
    Testing AI Voltage Reference...   (PASS)
    Testing AI Finite Sample Clock...   (PASS)
    Testing AI Finite Sample Clock Frequency...   (PASS)
    -------------------- Testing Digital IO... --------------------
    Testing DIO Lines...   (PASS)
    Testing DIO Ports...   (PASS)
     ----- DIAGNOSTIC TEST COMPLETE -----

  • Daq counter using gate input

    In our lab, we have a DAQ 6259 card. previously someone made a c++ programme. Now , i want to use labview to counter . but even i use the example(count digital edge), i cannot get the counts . So i tred it on test panels. only if the edge source is gate input(PFI9), it works. I am wondering what is the problem. could you give me some suggestion?

    hi, yao yong, you should read about the configuration you are choosing, the only situation i have seen about using a gate terminal as a input pin is when you signal is too slow and you're measuring frequency, you should try what Kwok How says about try counter input 0 or try daq assistant.vi
    Kwok How, i want to ask you or someone else if edge count or frequency measurement recognize every edge ( like noise-generated edges ) or just edges between 0 and 5 volts
    best regards
    .:. Pedro Rivera .:.
    i love to work and develop on labview, this is real fun!!!

  • Frequency measurement error using DAQSTC

    I have modfied the example listed to measure up to 9 frequencies continuosly in the vi as attached.
    When I use the same approach combined with analogue & digital input/output I get a small error in frequency.
    (Input line PF10 reads 6.8Hz for a 6.7Hz input.)
    Attachments:
    measure_9_frequencies.zip ‏50 KB
    Rig_13-2_Monitor-1.llb ‏196 KB

    Hello,
    The code that you are using to take the frequency measurement could be done with lower level VIs that will more than likely resolve this issue. I modified one of the LabVIEW shipping examples: Measure Period (DAQ STC).vi Please take a look at the VI that I have attached.
    Attachments:
    Measure_Multiple_Freqs.vi ‏98 KB

  • Modify example "Frequency Measurement.vi" for cFP to read two channels

    I am using the cFP-CTR-502 to measure frequency on one channel using a modified version of the built-in example, "Frequency Measurement.vi" found under 'Hardware Input and Output>Fieldpoint>Advanced'.  How do I modify this example further to incorporate additional frequency-measurement channels?

    AEICincy,
    Modifying the example for multiple frequency measurements shouldn't be too difficult.  If you wish to use the same gating pulse, the only thing you need to do is set up a new channel in MAX (set it up the same way you set up the first channel as per step 3 of the instructions), set the counter channel on the new front panel controls, and add code to read and reset the counter (which can be copy/pasted in the False case of the code).  I have attached an example of a VI with these changes.
    Message Edited by Devin_K on 01-28-2008 08:38 AM
    Devin K
    Systems Engineering - RTT & HIL
    Attachments:
    Frequency Measurement.vi ‏106 KB

Maybe you are looking for

  • Opening .doc files with wrong program

    Hi *, first I've installed open office. A few month later I installed micorsoft office. After that I converted all office files. Everything was working fine. Now my mac forgot to open .doc files with ms word, he chooses oo word. I do'nt have these pr

  • Bought a Nano to replace my old ipod but my itunes does not regognize it

    Please help. Spent the past 4hrs doing everything but my itunes with all my songs will not recognize my new nano. What can i do? Thanks

  • IPad mini stuck in restore for 27 hours

    I got my iPad Mini 2 yesterday afternoon, and began to restore from my iPhone. It successfully downloaded my apps and music but has neglected to do any photos, contacts etc. It has been connected to wifi continually since yesterday afternoon but it i

  • Creating Local partitioned index on Range-Partitioned table.

    Hi All, Database Version: Oracle 8i OS Platform: Solaris I need to create Local-Partitioned index on a column in Range-Partitioned table having 8 million records, is there any way to perform it in fastest way. I think we can use Nologging, Parallel,

  • EA2 - make error message text selectable

    Currently error popups display error text, but the text cannot be selected. It would be nice if this text could be selected so it could be pasted into bug reports, etc.