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

Similar Messages

  • PCI-6280 (M-series) digital frequency measurement

    Hello,
    I am trying to use a PCI-6280 board with NI-DAQmx and C++ to measure the frequency of an approximately 36kHz external digital clock source.
    I have been playing with the "Dig Freq-Low Freq 1 Ctr" example in the NI-DAQmx ANSI C examples directory, trying to get it to work. All I have gotten so far is error -200474 -- "Specified operation did not complete, because the specified timeout expired" -- in response to the call to the DAQmxReadCounterScalarF64() function.
    I think I am connecting the external clock source to the wrong input terminal.
    I am connecting the external clock source to pin 37, which the documentation says is the Ctr0 source terminal. I have also tried the other Ctr0 terminals (gate, aux, and out) and no luck.
    What am I doing wrong? Where should I connect the input signal so I can successfully measure the digital frequency?
    Any help will be appreciated! Thanks,
    Markus Svilans.

    Hi Markus,
    In order to measure frequency you need to connect your signal to the GATE of the counter (in your case this is pin 3). All counters use the Gate to take time measurements (for example period and frequency). Here is a good resource on this.
    Hope this helps!
    Abhinav T
    Applications Engineer
    National Instruments
    Abhinav T.
    Applications Engineering
    National Instruments India
    LabVIEW Introduction Course - Six Hours
    Getting Started with NI-DAQmx
    Measurement Fundamentals

  • Digital frequency measurement

    Hi,
    I'd like to measure the frequency of a digital input signal with my PXIe-6358.
    I have found examples and codes like  Help » Find Exampels » Hardware Input and Output » DAQmx » Counter Measurements » Digital Frequency » Meas Dig Frequency-Low Freq 1 Ctr.vi
    and
    http://decibel.ni.com/content/docs/DOC-6271
    however the problem is that this digital signal connects to one of the pins of the port0.
    Is there an efficient way to measure the signal frequency directly from port0?
    Thanks.

    Hi Krivan
    Port zero is a digital input output.
    To mesure input frequency using digital input
    lines. There is an example on haw to do this using two counters in DAQmx.
    You will also have to define the port as input as
    well this can be done in MAX in the test panel tab.
    http://decibel.ni.com/content/docs/DOC-11420
    Regards
    Robert
    National Instruments UK & Ireland

  • 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  

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

  • Digital Frequency Measuremen​t for cRIO

    Hi,
    I'm new to LabView, and I'm having problems setting up a VI for frequency measurement. Any tips would be greatly appreciated!
    Task: I am using a cRIO with a digital I/O module (NI 9403). My goal is to connect the sensor that I am using (a MAXIM 6576 temperature sensor with period/frequency output in the form of a square wave) to the cRIO and have a VI measure and output its current frequency or period. 
    I've tried working with the Count and Period.vi, but when I tried to compile I found out the 9403 module does not support SCTL. I also looked at a thread that was posted in 2009 (http://forums.ni.com/t5/Counter-Timer/beginner-stu​ff-cRIO-digital-frequency-measurement/td-p/826656/​... that discussed a similar problem, but when I tried using the Host VI I got the multiple error messages saying "Function not supported in current target". This happened even when I tried using the original Count and Period (Host).vi with no modifications (but the original Count and Period (FPGA).vi works just fine). 
    I don't know how to approach this problem - should I be using FPGA or Scan Interface mode? Are there any basic examples of frequency measurement or digital counters that do not involve NI data acquisition devices? For a basic counter, how would you set up the VI so that it could measure the period or frequency based on the counter values? 
    Thanks a lot for your help!
    Andrea

    Hello,
    A great place to get started when using a cRIO is the NI CompactRIO Developer's Guide.  It will explain both Scan Mode and FPGA.  The difference between them comes down to the functionality and what you would like to complete in the program.  The simpler of the two is Scan Mode but you have more functionality with FPGA.
    We offer a lot of good examples in our NI Example Finder by going to Help >> Find Examples.  In here you can narrow the examples by hardware or just browse to different categories.  We do have a counter example that will work with the NI 9403 you can get to the example by going to Hardware Input and Output >> NI Scan Engine >> Module Specific >> Digital Input >> “Digital Line Input – cRIO.lvproj.” 
    Regards,
    M. Whitaker
    ni.com/support

  • What's the maximum digital I/O frequency for the NI LabVIEW RIO Evaluation Kit ?

    Hi!
    I'm trying to analyze some sort of sine signal at the frequency of about 3 MHz. Because the analysis should be very precise and fast (about 10 samples per period), I'm needing the maximum digital I/O frequency of the NI LabVIEW RIO Evaluation Kit.
    Regards,
    Erik

    Dracyon,
    Can you please clarify a couple of things: you say you are trying to acquire a sine wave that has a frequency of 3 MHz, but you are asking for the maximum DIO frequency. I believe what you need to know is the maximum analog sampling frequency. For the sbRIO-9636 (part of the evaluation kit), the maximum aggregate sampling frequency is 200 kS/s at 16 bits of resolution. At 10 samples per period, you could sample a ~20k analog signal. If you are actually looking for maximum DIO frequency, this is a bit more complicated. We have a good whitepaper explaining this.
    Best,
    Tannerite
    National Instruments

  • Is it possible to make a Frequency Domain Reflectometer using LabView? For waveguide frequency measurement?

    Hi everyone
    I have a tricky question that I have looking around for the answer but couldn't find it!
    I want to know if I can build a Frequency Domain Reflectometer (FDR) to measure frequency return in waveguide. Telecommunication engineers would understand what I mean! It a bit like TDRs but its frequency instead of time. 
    I would like to build a Frequency Domain Reflectometer using labview application, how can I do that? What sort of code do I need and what equipment do I need to operate with the NI code?
    Please give me the chance to thank you all very very much for your help and support and for looking here,
    regards
    Fezz

    Hi Fezz,
    I am not familiar with using FDR systems but know there is a good example of producing a TDR in LabVIEW available on the community. This might provide you with a base and a grasp of the architecture you could use to create the functionality.
    Time-Domain Reflectometer (TDR) Example
    Regarding the equipment you would require to achieve this I strongly recommend contacting your local NI office who will be able to adviser you fully as this will depend upon your desired specification.
    Kind Regards,
    Aaron. E
    Applications Engineer Team Lead
    National Instruments
    ni.com/support

  • Measuring digital frequency

    Dear,
    I am working on a test stand that will be used for fatigue tests for a suspension, chassis etc. De vehicle components will be charged by hydraulic cylinders. These hydraulic cylinders are controlled by an AO and DO module (NI9263 & NI9401). Feedback is given by load cells. These load cells are connected with AI module (NI9201). When a cylinder reaches a certain force (certain amplitude load cell NI9201) the cylinders stops pulling and will make an outward movement. This signal is 0 when outgoing and 1 when certain force is reached. A green led starts to burn (signal is 1) when the force is reached. Now I want to count the amount of times that the signal is 1 so that I can make a security system that will limit the amount of ingoing and outgoing movements of the cylinders. Can you help me?
    Kind regards,
    Michael Tielemans
    Solved!
    Go to Solution.
    Attachments:
    test stand juli 2010 (dynamisch).vi ‏4087 KB

    Dear,
    I am still unable to count the digital frequency. The signal from the load cells (0 or 1) can not be added to the digital frequency block diagram that was sented by Bas van Dijke. Which wires do I have to connect? I also have tried to manipulate the signal from the load cell, but this didn't work either. Can you look at the attached VI?
    Attachments:
    test stand juli 2010 (dynamisch).vi ‏4089 KB

  • 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

  • Frequency measurement keep reading value when stop rotation

    Hi,
    i am doing the program in the attachment 
    in this program i am using ni9401 and cDAQ 9188 to measure frequency from motor driver 
    but i am facing some problems 
    1. the reading sometimes different than osciliscpe.
    2. when i stop the motor the program still read values and not going to zero |
    Note my driver send the feed back as a signal"Pulses" with difference frequencies depend on my speed . i send digital values to the driver pins 111 to make it rotrate forward and 100 to make it stop rotating + analog value to change the speed 
    can i have help in that ?
    thanks 
    Attachments:
    speed calibration.vi ‏161 KB

    As I understand this you are trying to read the frequency of an quad encoder and the reading is fine as long as the quad encoder is at a steady speed but when it is changing speed you are getting random frequency values.  I looked at your code and nothing seemed to jump out at me as being wrong with it but I do have a couple suggestions to see if we can narrow down where the issue may lie.
    If you could just try running on of the examples found in the example finder (Help»Find Examples...) specifically example Hardware Input and Output»DAQmx»Counter Measurements»Digital Frequency»Meas Dig Frequency-Buffered-Cont-High Freq 2 Ctr.vi.  And just wire the output to a waveform chart or a dial and see if you are seeing the same results there.  If that is giving expected results i would just implement your formula node and averaging into that example and save it as your code.  I have attached an image of such an implementation.
    Doug Farrell
    Product Manager - Condition Monitoring
    National Instruments
    National Instruments Condition Monitoring
    Attachments:
    example code.png ‏44 KB

  • NI9411 wrong frequency measurement of flow sensors / 24 impulse signals

    Hello Ni Forum,
    I already searched for similar problems, but haven't found anything helpful. So I'm posting our problem here. I'm apologizing in advance for bad english, it's not my mother tongue
    We're encountering some strange behaviour of our NI9411 Module. We're using it in a Compact Rio with some other modules (2x Analog In).
    Our goal is to measure the frequency of three flow sensors (impulse high = 24V, 0-22kHz) among with a torque sensor (TTL 5V, 30-60kHz) and a speed sensor (TTL 5V, 0-51,2kHz).
    They are wired as follows:
    DI0a = torque sensor
    DI1a = flow sensor 1
    DI2a = speed sensor channel A
    DI3a = speed sensor channel B
    DI4a = flow sensor 2
    DI5a = flow sensor 3
    Correspondig ports b are left unconnected, as it is said in the data sheet. All ground ports of sensors are connected to COM port of 9411. The module was connected to a 24V power supply.
    Now the torque and speed sensor measurement works fine. But measuring the signals of the flow sensors seems to be difficult.
    If an external frequency generator (impulse high about 9V, f=1,000kHz) is connected to port DI1a instead of the sensor signal, LabView shows exactly 1,000kHz. DI5a showed an avarage of 10 Hz, with a range from 10 to 60 Hz. DI4a equaled constant zero. The flickering up to 60Hz of DI5a was gone after disconnecting the 24V supply of the module. This changed nothing on the phenomenon described below.
    If the signal high impulse voltage is raised, the measured signal frequency goes up to 1300 Hz @ 24V signal high impulse voltage. The signal additionally raises, if an oscilloscope is connected to DI1a, to 2180 Hz (range 2110 to 2240Hz). However, there is no change of frequency if the osci is connected to DI5a. With the 24V supply connected, DI5a showed a frequency up to 600Hz @ 24V signal high impulse voltage on DI1a, also rising when connecting the osci on DI1a. As mentioned, there was no frequency measured on DI5a after disconnecting the 24V power supply.
    The signals of the generator showed some peaks on each edge (rising and falling) with values for example of 11V above high impuls voltage of 9V (20V together). That may causes that wrong frequency measurement.
    The signals of the flow sensors do not have such peaks, the LabView-frequency nevertheless does not match the real frequency, as shown below (all values in Hz):
    LabView
    ideal values
    Flow Sensor 1
    Flow Sensor 2
    Flow Sensor 1
    Flow Sensor 2
    4600
    12200
    740,6
    6760,0
    6400
    13500
    1481,3
    7500,7
    9700
    16400
    2962,6
    8982,0
    12900
    19500
    4443,8
    10463,2
    We're kind of helpless now. How can we get the signals of the flow sensors measured the right way? Are we doing something essentially wrong? Thanks in advance for offered help. I hope, I've given any necessary information. Any missing details will of course be delivered.
    Puls-Measure-VI is attached beneath.
    Regards,
    Johannes Rost
    Attachments:
    vi.png ‏20 KB

    Dear Lynn,
    thank you for your reply. The impedance was an issue that our local technical distributor already suggested to check. According to the datasheet of the flow sensor (see attachement) it can drive a current of 25mA. The signal generator we used is a test generator that can be used instead of the flow sensors to check the any evaluation unit the sensor is connected with. So it should generate signals that are equal to those the sensor would have generated. And even with this the frequencies measured with LabVIEW are not as expected.
    We are in contact with the sensor manufacturer to exclude mistakes in connection on the sensor side. But the behavior with the signal generator makes us think that is has to do something with the characteristics of the NI9411 that we don't know yet.
    Attachments:
    block diagram signal amplifier and signal description.png ‏151 KB
    technical data.png ‏124 KB

  • Why does my AI acquisition slow down to my frequency measurement rate?

    I'm using Labview/Daqmx to program my SCXI 1520 and TC modules while at the same time using the multifunction capabilities of the E-card controlling the SCXI.  This has been fairly easy until I wanted to use the frequency and counter measurements (outputs/DIO works great).  I'm using a waveform with buffered acquisition for the read on the AI channels and obviously there is no waveform for the frequency measurement so I'm just combining the signals using the dynamic data.  This works great when my input frequency is higher than my acquisition frequency.  When my input frequency is lower than my acquisition frequency the acquisition slows down to that frequency and the AI read falls behind (buffer fills while waiting for another frequency measurement).  I'm assuming the frequency read is not keeping up with AI read.  I understand that as the frequency is reduced it takes more time to calculate the frequency.  So how do I "read" the frequency measurement at the same rate as the AI data?  I'm fine with using the last frequency measurement until a new frequency measurement is available but I can't even seem to be able to do that.
    An example of the problem is measurement of vehicle pedal force (AI channel) with pulse input for vehicle speed.  Assuming 100 Hz acquisition and the vehicle stopped or going slow (very slow pulse train) I should be able to acquire data at 100 Hz even if I just use the last data point for the frequency channel until another point is available.
    Please help, thanks.

    Basically, the very fact that you're *doing* a frequency read suggests that you don't know the expected freq ahead of time, and probably suggests that it can vary.  The waveform datatype assumes a constant interval between samples which wouldn't generally be true for frequency measurement, and that's why you can't use it.  Since the actual timestamps of the frequency measurements are NOT the same as those in the analog waveform, it's likely a mistake to pretend they are.
    My method is to create my own array of "timestamps" for the frequency data.  Create a For loop with a shift register initialized to 0 from outside the loop.  Let your freq array auto-index the loop.  On each element, perform (1/x).  Add result to the left-hand shift register value and write it to both the right-hand shift register and to an auto-indexing output.  When the loop completes, the output array will hold timestamps that correlate to your freq measurements.  From there you can choose whether to display on an X-Y Graph, or whether to perform some interpolations to calculate freqs at the analog sample times or vice versa.
    -Kevin P.

  • How to increase measuring speed of Agilent 34401A

    The process of my program (written in Labview) is:
    1) A control code is automatically generated by the program, and the code is sent to multiplexing circuit (the chips I used are ADG706) through digital port (USB6501 from NI)  then a coresponding channel is selected. (for example code hex0000 selects 1st channle,0001 selects 2nd channel, and so on......)
    2) Multimeter Agilent 34401A measures the current value of this channel, and send this value back to the computer for storage. After this, the program goes back to step 1) for next channel, and this program executes like this.
    The functions mentioed above are all realized, and the program works well, but the problem is the speed is slow. It takes a little more than 1 second to measure one channel, totally I have 2048 channels (32 groups and 64 channels in each group, I used two layers of "for" cycles), and it takes about 32 minutes to finish measure all these 2048 channels, too slow, I'd like to reduce them to 10 minutes.
    I tried to reduce the resolution to 4.5, turn off the autozero function of multimeter, but nothing happens, no change of the speed. Now every time the multimeter measures a channel, it makes a "click" sound, does it mean that every trigger the multimeter only takes one measurement? Is there anyway I can increase the measuring speed? Can I send the multimeter 64 control condes a time, and then let the multimeter takes 64 measurments in one trigger? Is it right? If so, how can I realized it?  If I'm wrong about it, can you give me some solutions?
    Thank you very much! 

    I don't have the manuals with me, but I do have a couple of these in my lab.   There is an internal buffer where you can store (I think) 512 readings.   You can use a digital output to trigger the DMM, and only transfer after every 512 readings (4 times) or perhaps one read per group as you mentioned.  I suggest one read per trigger (you can do many more) since it is easier to synchronize with your channel changes.  I believe the commands are INIT and FETCH?, check your manual.  The two times I know the instrument "clicks" are changing functions and certain range changes.  I suspect in your attempts to speed things up you are sending some config. commands each time.  Configure it once initially and make certain you are only sending measurement related commands during the scan, any config. changes (even if you resend the current value) will likely cost you time. 

  • Frequency Measurement Algorithm

    I'm writing a VI where I need to measure the
    frequency of a pulse. This frequency is proportional to a physical measurement,
    in this case flow rate. I know how to get the frequency measurement into my VI,
    and all is well as long as the frequency is higher than my VI update rate. But
    things become more complicated and non-trivial when the frequency drops below
    the VI update rate, because during some loops there will be no pulses occurring
    since the last loop. In this case I could just assume that the frequency is the
    same as last time, and for constant frequencies this works well. But there is
    also the case where the flow rate has suddenly stopped, and hence a zero pulse
    frequency. If I assume that the last known value is also the current value, my VI will be stuck
    reporting the last known flow rate, and will not ever report a zero rate. It
    must be the same as a digital frequency to analog converter, but I couldn’t
    find information on the algorithms used. Has anyone worked out a solution to
    something like this using Labview?

    Hi,
    I have done something similar before. You mention frequency to analog conversion - that's precisely the principle I used. Basically you count your pulses (cycles, level crossings, etc.) and feed them into an integrator. Mathematically it works like this:
    F(0) = 0;
    F(i) = [ F(i-1) + N(i)/T ] exp (-t/T);
    F(i) - frequency after the i'th iteration
    N(i) - number of pulses detected during the i'th iteration
    t - iteration time
    T - the integrator time constant
    For a fixed frequency the estimator output stabilizes at N/t, but if the pulses stop coming, e.g. N=0, the output will decay to 0.
    Use smaller T for a more "responsive" frequency estimator, larger T for a more "steady" one.
    Hope this helps!  Zador.
    P.S. Here's a link to a previous discussion on pulse detection:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=191867#M191867

Maybe you are looking for

  • How can I control an iPad from a touch screen which is mirroring the iPad screen

    How can I control an iPad from a touch screen which is mirroring the iPad screen. This is a very important application for disability students who wish to use iPad apps but do not have sufficient fine motor skills to use the small screen of an iPad b

  • Move out Info Provider to other server without transport connection?

    Hi All, Could you share you thought ? Is there a possibility to move out the info provider design & info object to other server without transport connection ? The background is our project box will be decommissioned, and unfortunately it's not connec

  • Reverting to original RAW files

    My question is: suppose I make major (or minor) adjustments to many files in a folder. I know I have not really altered my originals but...is there a way to get those LR files in that particular folder with those changes I made back to my original st

  • This is not just H.264, This is Apple TV compatible H.264

    I bought an Apple TV hoping to use it as a viewing station for content previously webcast and recorded using QuickTime Broadcaster. After the webcast I took the resulting H.264 file which QTB recorded during the webcast and dropped it into Itunes whi

  • OS 10.8 issue - need to relaunch finder everytime open file

    Installed Mountain Lion on my Mac mini (Late 2009).   Works great except when I open any file type from the finder.    Finder window appears to hang up and need to relaunch everytime) I'm thinking of adding more memory as I only have 2Mb.  I don't th