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

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

  • 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

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

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

  • 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

  • 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

  • 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

  • Unstable Frequency Measurement USB6210

    Hi All, 
    I'm struggling to get a stable frequency measurement, to measure the RPM of a motor, using a single counter on a USB6210 board. 
    I'm using the +5V TTL signal to power an opto-transistor, and reading that signal back through Ctr0 (PFI1). See attached wiring schematic.
    I've put a scope in line (between PFI1 and DGND), and at the PFI1 terminal get a square wave, about 50Hz, peaks at about 2.5V. Do I need to be linking this signal to DGND, and how?
    I've set up a task in MAX, and readings fluctuate from 45Hz to 900Hz.
    I've also tried to read this in LabVIEW using the example VI - Meas Dig Frequency-Low Freq 1 Ctr.vi. I then get even more random results of +100,000 (full scale).
    Many Thanks,
    Martin 
    Attachments:
    Counter Wiring.jpg ‏63 KB
    24022010044.jpg ‏397 KB

    thanks a lot John P, i'll try it this vi config.
    well, my flow transmiter should give an 0-5 volts signal with frequency between 0 and 100 hz (datasheet here), and the data i need is codified in pulse frequency, the measured voltaje is wrong but frequency on oscilloscope is ok. i attached pics of my signal on oscilloscope measured on transmitter output, measures at daq card input are the same, i connected my transmitter ground to digital ground (im working on ni pci 6221).
    i tried the  Minimum Pulse Width option with 2.56 ms but now i realized why did'nt worked (voltaje level issues ), but now my typical noise is 3% of my signal, i think noise won't be a big deal.
    and i was surprised too about this system could get data acquisition insteand of data timeout error (because of voltaje level's issues), at first test i performed the system made the measures already mentioned, but i realized the ones who made this system attached the signal acquisition line to waterpump's power source (in fact, they attatched all data signal's lines to waterpump's power source ¬¬) and they hid noise effects with waveform's settings, now i fixed this and the system only shows me data timeout error.
    initially i got confused because if im getting frequency acquisition of milivolts signal i thought daq card's counter input could deal with it, but now i realized it was just noise peak effects.
    best regards
    .:. Pedro Rivera .:.
    i love to work and develop on labview, this is real fun!!!
    Attachments:
    signal acquisition.zip ‏355 KB

  • 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

  • Frequency measurement question

    hi,
    i'm trying to get a graph/table of the frequency of a signal as it varies with time using LabVIEW 8.2. the frequency of the signal i'm analyzing is constantly changing, so i would like to, ideally, find the frequency of each pulse so that i would be able to graph that frequency as a function of time. the signal is generated by a fiber optic system which is hooked up to a standard NI DAQ card.
    right now i'm trying to use the Spectral Measurement VI wired to a graph, however it doesn't seem to be producing the desired results.
    thanks

    Hi Ben,
    Ah, I get it now, thank you for the pictures.
    "Just
    to clarify, does the Counter I/O -> Frequency task work with
    non-digital signals?"  No, the input to a counter task must conform to
    the 5V TTL logic standard.  Here
    is a document that talks about how to use non-TTL signals with counter
    tasks.  Since you are interested in the length of time between two
    adjacent peaks or troughs, it would be nice to use a digital frequency
    task, but this analog signal needs a lot of help before you can use it
    as a TTL counter input.
    "Also,
    it would seem that the Analog I/O ->
    Frequency would be the ideal task for my application, however it
    doesn't seem as though it is supported by my card..." You are correct,
    you cannot directly take an analog frequency measurement with your
    hardware.  Different hardware is required.
    What's coming to mind is a direct measurement between two adjacent peaks and troughs.  LabVIEW ships with some very nice examples for this type of measurement.  From LabVIEW's Help Menu >> Find Examples... >> Analyzing and Processing Signals >> Time Domain Analysis >> Peak Detection and Display.  Please note that some of the VIs required by this example are not included in the LabVIEW Base Package.  Below is a screen shot of the front panel.  Computing the frequency of each pulse is then a matter of calculating the time between two adjacent peak or trough values.  I hope this gives you some ideas.
    Message Edited by Pie56694 on 07-09-2008 11:34 AM
    Message Edited by Pie56694 on 07-09-2008 11:35 AM
    Attachments:
    2008-07-09_101048.jpg ‏94 KB

  • 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

Maybe you are looking for

  • An Open Letter To MSI - A very dis-satisfied *former* customer

    I sent this letter to as many MSI email  addresses as i could find: Sirs: I’m done with MSI. I’ve bought two MSI K8N Neo Platinum boards and two K8N Neo 4 Platinum SLI boards. My original K8N ran great without problems for nearly a year, then one nig

  • How can I get the data back from my game

    How can I get the data back from minecraft if I deleted the app and bought with a different Apple ID

  • Need help with buttons in a phone simulation

    Hello I have built a telephone interface to be used for training in a Call Center. I am attempting to allow the user to press on the numberpad to enter passwords and such. It is only a simulation and will only work if the user presses the correct but

  • After using GUI_UPLOAD, '#' appears in my itab

    Hello experts, Why is that after using gui_upload, the symbol '#' appears before and after each of record? Again, thank you guys and take care!

  • ITunes+Denon Airplay Receiver

    My iTunes only occasionally is able to locate my Denon AirPlay equipped reciever hooked up to an Airport.  But my iPad can find it to work the remote. Why is it a random wheel whether iTunes will allow me to use the AirPlay Receiver?