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

Similar Messages

  • 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

  • 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

  • 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

  • PCIe-6321 frequency measurements

    I am trying to use a PCIe-6321 to perform a simple frequency measurement (800-2500hz).  Are there daqmx functions for frequency measurments?  I tried some of the CVI examples but they throw error messages.  Is there an example were I can measure frequency on one of the analog inputs?

    Your card have both analog inputs and counter inputs; they behave differently and for each of them there is a set of examples that explain the basic measurement types together with cabling.
    Search with the example finder (Help >> Find examples... menu item) with "counter/timer" keyword and you'll find the examples you are looking for. Also looking for "frequency" drives you to the same examples.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • 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

  • 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

  • Continuous frequency measurement~

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

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

  • 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

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

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

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

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

  • PXI-6624 Pulse Frequency measurement

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

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

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

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

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

  • Scxi 1126 frequency measurement along with other scxi modules

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

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

Maybe you are looking for

  • Importing VHS video into FCE4 via a camcorder

    Hello, I'm trying to import some old family videos that were recorded on an old VHS camera (now long departed) into Final Cut Express 4 using a Sony DCR-TR330 camcorder & a VHS player. The camcorder is connected to my iMac via the firewire interface,

  • Can't sync contact with my MBP

    Dear All, My MBP is osx 10.6.8 and iPhone4 5.1.1 Last week my iphone can't sync contacts with MBP, it sync with my gmail contacts! I try to reset my iphone and sync again, but it can't work. Only contacts have problem, calender is work fine. Anyone k

  • BMP question : got javax.ejb.EJBException error Object state not saved

    Could anybody please help me? I could not figure out what i did wrong. I got the javax.ejb.EJBException error: Object state not saved when i test the getname() method for findByPrimaryKey() and findAll() methods. Here is my code: package org.school.i

  • IPod Corrupt - Can any one help!?

    Hi, I recently installed iTunes on my desk top and transfered all music from my laptop. It worked perfectly for a few days and now its corrupt. Everytime I plug my ipod into the PC, it tells me to restore. I have done that and it has deleted all musi

  • Cs4 quick selection tool program error

    When ever I try to use the quick selection tool in photoshop cs4 it gives me a can't complete the request program error. I have turned off open GL I have the latest drivers.  It never did this before.  I reset the preferences file more than once.  An