NI-DAQmx frequency sampling rate

Hi there!
I'm working on setting up a data acquisition Labview VI, to measure different signals on a test rig.
I'm using the NI-DAQmx assistance (the Express VI?) to continously measure analog signals (Variable current, voltage and temperatures). This is working just fine, and i can change the sampling rate by writing to the express VI. The idea is, that the user can change the sampling rate from around 1 to 500 Hz. 
We do however have a sensor that transmittes digital signals (a frequency), and are using a NI-9423 module to "read" it. As this is a digital signal, another NI-DAQmx express VI is needed to handle it (that's ok), but so far we can't figure out how to alter the sampling rate - it's apperently locked at 1kHz. 
Being that we want to merge the analog and digital signals to one array, we are recieving overflow errors from the "analog" DAQ, if it's not set at exactly 1kHz. 
So, in short - is it possible to change the sampling rate of a DAQmx recieving frequencies? So that we to DAQ assistences have the same sampling rate?
Help would be greatly appreciated!
- Nicklas
Attachments:
DAQissue.PNG ‏64 KB

Unlike voltage measurements, which tend to be (more or less) instantaneous, frequency measurements take a finite (and often variable) amount of time.
If it is a slow signal then you measure the number of counts of your reference clock that occur in one period of your input signal. As your input signal varies in frequency, so does the measurement rate. If it is a fast signal, you can either measure how long it takes to get n cycles or your input (again variable) or you could count how many cycles of your input occur in a fixed time period.
The NI help on frequency measurements describes three different ways you can configure a counter to measure frequency.
The long and short of this is that generally counter measurements come at variable measurement rates which can be problematic to fit in with a fixed rate loggin system. If the measurement period is much smaller than your desired rate then you can wait and trigger a measurement at regular intervals. If not, you can let the counter run at its own rate, placing the latest result on a notifier, and in another loop just read the latest measurement from the notifier each time you want to record a result. Depending if you counter is running faster or slower than your desired logging rate you will end up with either missed samples or repeated samples. There are inherant timing inaccuracies in both approaches because, unlike analog measurements, the counter measurement is not made at 'that exact time, now!' but over a period of time which may be long or short compared to your logging rate.

Similar Messages

  • How can I programmatically determine the capabilities of a card under NI-DAQmx (e.g. max sample rate, number of AI/AO/CTR channels, etc.

    Is there a DAQ_Get_Device_Info() equivalent for NIDAQmx? I need to iterate thru all the devices on my system, and build up a list of device capabilities. The system may include M-series and E-series cards.

    Attached is a program I've used in the past to determine number of AI channels. It could be easily modified to check for AO or digital or counter. Also, there is a ton of properties that you have access to (i.e. max sample rate, max/min voltage inputs, etc.) that are accessed as properties of the type of channel, or timing properties, as opposed to properties of the board. Check out the DAQmx C Reference Help (Usually at Start>>All Programs>>National Instruments>>NI-DAQ). Expand the NI-DAQmx C Properties, and look at the List of Channel Properties, and Timing Properties, etc.
    -Alan A.
    Attachments:
    Device_Info.vi ‏25 KB

  • Sample Rate vs Frequency

    "The increments across the x-axis of the graph are controlled by the sample rate.  In this example, 8000 units along the x-axis represents
    one second of audio. "
    Actually not. One should sample at twice the highest possible input frequency.
    Renee
    "MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me

    You see basically an FFT describes the frequencies and amplitudes of samples or events. If one undersamples one cannot hope to describe the event and that's what it's all about. If one samples at a rate less than twice the maximum frequency one cant cant
    hope to describe the event because one cant be certain that data is take fast enough to describe it. I'll give you a worse case example.
    Consider an electrical sine wave occurring at exactly 1 khz. The signal oscillates from +1 volts to -1 volts at the rate of one khz, Let us consider what would happen if we sampled this signal at 1 khz, We would see a constant voltage at the input although
    the signal is changing sinusoidally at a 1 khz rate, If we sampled at 1.5 times the signal we'd see variations. And if we sampled at twice the maximum frequency we could be sure we're sampling at a rate which will allow description of the input.
    Renee
    "MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me
    Not quite.
    When you're taking a true analog signal and "digitizing it", it will never have the resolution of the analog signal ever again.
    The faster the sampling rate, the closer the approximation but the actual digital result is and will always be a square wave (not triangle wave, not sine wave, a square wave).
    The faster it samples it, the closer the "stair" to the next one, thus more closely approximating the original sine wave, but it can never be completly true to the original signal.
    This isn't related only to sound but to any true analog waveform being "digitized".
    Please call me Frank :)
    Well maybe you could do something like a Bezier curve or
    Bézier Spline that would only need 4 points for each half of the wave in order to match the wave or something digitally? I don't know much about it but it seems to me you could somehow match an analog waveform digitally.
    Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image
    will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.

  • Is it possible to detect low frequency signals with a high sampling rate?

    Hello everyone,
    I'm having an issue detecting low frequency signals with a high sampling rate.  Shouldn't I be able to detect the frequencies as long as the sampling rate is at least 2 times the highest frequency I will measure?  The frequency range I am measuring is 5-25 Hz, and I use Extract Single Tone.vi to measure the frequency.  The sampling setting I am using is 2 samples at 10 kHz.  Is there a method I can use to make this work?
    Attached is the vi.
    Attachments:
    frequencytest.vi ‏21 KB

    You are sampling at 10Ks/S, but only taking two samples. What do you expect to see? If your signals are binary (On or Off) you would only see either an on or an off, or if the rise/fall time was fast and you were Extremely lucky, one of each. If you want to see a waveform you have to sample for at least the period of a waveform. So you should take samples for at least 0.2 seconds to capture an entire waveform at 5Hz, ideally longer.   Think of looking at a tide change at a dock. If you want to see the entire tide change you will probably have to measure repeatedly over 24 hours, not just run out on the dock, measure the height twice and leave. That wouldn't tell you anything other than at that precise moment the tide height was X, but not that it was at high tide, low tide, in between, etc.
    I type too slowly, I see that a more technical answer has been given, so mine will be the philosophical one!
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • How to use on board counter to change sample rate dynamically on pci-6134

    Hi,
    I am relatively new in LabView.
    I am making power quality measurement system and I need to vary the sampling rate of my pci-6134 dynamically (all channels simultaneously). What I need is to have a constant amount of samples in each period of measured signal (grid voltage), which changes slightly all the time. Therefore I will have to measure the voltage, find its exact frequency and then adjust the sampling rate of daq accordingly. I know that there will always be some delay, but I would rather like not to go into any predictive algorithms...
    I have found an information in the Forum that one of possible solutions is to use an onboard counter to change the sampling frequency but I have no idea how to make that. Can someone help me or possibly show an example? 
    Is there a simple way to solve that problem?
    Thanks in advance
    Andrzej

    At least at a glance, the code generally looks like it ought to work.  Two thoughts:
    1. Instead of getting into PFI3 vs PFI8 routing stuff, can't you just specify "Dev1/Ctr0InternalOutput" as the AI Sample Clock source?  (You may need to right-click the terminal to get at the menu that exposes the so-called "advanced terminals").
    2. Try writing both the freq AND duty cycle  properties when you want to update the freq.  Or try using the DAQmx Write vi instead of a property node.  My past experience suggests that writing only the freq property *should* still work, but writing both isn't hard to try and may turn out to help if the behavior of your version of DAQmx differs somehow.
    -Kevin P.
    P.S. Bonus 3rd thought.  I just went back to reread the thread more carefully, including your first screenshot.  I'm now thinking that maybe the hardware actually WAS behaving properly, and that you just weren't aware of it.   When you query the AI task for it's sampling rate, all the task can know is whatever rate you told it when you configured it outside the loop.  So even as you change the counter freq to change the actual hardware sampling rate on the fly, the AI task will continue to report its orig freq.  After all, how is *it* supposed to know?
           Try an experiment:   Set your original freq very low so that the AI task produces a timeout error without getting all the requested samples within the 10 sec timeout window.  Run and verify the timeout.  Then run again, but after 3-5 seconds set a new frequency that will produce all those samples in another 1 sec or less.  Verify that you get the samples rather than timing out.  That should demonstrate taht the counter freq change really *does* produce a change to the hardware sample rate, even though the task property node remains unaware.

  • ADjusting the sampling rate on a FIR filter?

    How do I adjust the sampling rate on a digital FIR filter? Thanks in advance.
    -David

    You should really start a new thread instead of posting to one that is 5 years old.
    To answer your question, it depends on your data. I don't use the DFD but with the filter functions in LabVIEW, if you pass a waveform data type to the function, then the waveform data type contains a dt value. So, set the DAQmx Read to return waveform data. If you are using low level filter functions where the input is a 1D DBL array, then the filter has to be configured. With the low level functions in LabVIEW, you use the various coefficients functions that have a sampling frequency input.

  • NI Scope 5122 Variable Sampling Rate

    Hello,
    I'm using an NI 5122 high-speed digitizer card to acquire data and would like to synchronize the sampling rate of the card to the frequency of the data.  For example, my first set of data will have a frequency of 13.6MHz so I'd like to sample at 13.6MHz.  When I connect a 13.6MHz signal to the CLK IN on the front panel of the card and write Labview code to sample at this rate (by either the sample clock or reference clock) I receive error messags.  Does anyone know if its possible to have a truly variable sample rate for this card?
    Thanks,
    Steve
    Solved!
    Go to Solution.

    Hi Steve,
    Thanks for the post and I hope your well today!
    I noticed you've not had any support thus far.
    Im not very familar with NI-scope, but with DAQmx once the task has commited you wouldn't be able to alter the sample rate. Now with pulse train generation you can (create) what effectively appears to be a didn't sample rate.
    So unless NI-scope has built in this functionality, Im not sure it would be possible. 
    Could you maybe attach your code and the error details?
    Kind Regards,
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • How to know the sampling rate for NI6624?

    Dears,
    I am trying to measure a transient signal that is a time-vary counter train.  The target frequency is increased from 0 Hz to 50 Hz when the measurement time rises to 1 s from 0 s.  The NI 6624 card and the LabVIEW DAQmx have been adopted.  In the block diagram, the terminal of measurement method “Low Frequency with 1 Counter” is set in “DAQmx Create Channel (CI-Frequency).vi”, and the “Finite Samples” mode is chosen in “DAQmx Timing (Implicit).vi”.  Then the transient signal points (increasing-frequency points) will be got successfully within 1 s.  Now I have a question: how do I estimate the time step “dt” between these data points?  Knowing the default sampling rate of the card seems a better way to help me to define the "dt", and calculates the time stamp at each data point.  If the foregoing concept is true, how the internal sampling rate in NI6624 obtains?  Beside, for the transient counter signal, any way to get the time stamp of data points is also welcome.
    Thanks for anyone comment,
    Adan

    Adan,
    When selecting "Implicit" as the DAQmx Timing type, you are indicating
    that a data point will be taken for every measurement the counter
    performs. When you create a task of type "Low Frequency with 1
    Counter," the counter simply uses the card's internal timebase to
    measure the period between edges of your signal. It then takes this
    period measurement and converts it to a frequency. Therefore, the
    spacing between the samples you read out is simply the inverse of the
    subsequent frequency measurement sample.
    Hope this helps,
    Ryan Verret
    Product Marketing Engineer
    Signal Generators
    National Instruments

  • Setting sample rate for sinus analog output

    Hello,
    I've been trying to do something very simple : using an analog output of the card PCI 6221 to produce a sinus curve of frequency 50 Hz. For this I used a Vi to create a sinus curve and the different DAQmx VIs. But I have difficulties understanding the principle of virtual channel and I think I'm doing a mistake setting the sample rate and samples number : one time for the sinus vi, second time for "DAQmx - Timing". Should I use the same values for both of these VIs ?
    On my oscilloscope, with frequency=50Hz and sample rate=1kHz, I get a null signal. Then depending on both values, I get differently rated signals. For example with f=1Hz and sr=10kHz, a sinus of frequency 0,7 Hz.
    Solved!
    Go to Solution.
    Attachments:
    Sinus analog output.vi ‏32 KB

    Yes, thanks for your advice. I used the structure given in the example and now it's working fine. I'm still not sure what I did wrong though.
    I would have a second question now (should I create a new topic?):
    I put a continuous sine wave on the analog output. As soon as this is running, (or maybe after a short delay) I want to measure a limited amount of samples on my analog input. How can I be sure, it's not going to start measuring before the output is properly set ?
    I don't think a trigger would solve the problem since I'm going to vary the output Amplitude.

  • How to acquire data from 2 chs of the same DAQ card at different sampling rate

    I am using single DAQ card (either 6013 or 6014) in my system i want to acquire data from 2 (or more) channels with following requirements
    1. sampling rate of each channel should be independant of each other (say one is 20 Hz and other is 15 kHz)
    2. data from all the channels should be acquired simultaneously.
    3. coding must be done using DAQmx VIs
    I have tried out following things
    1. I created separate task for each channel: i found out that two tasks can not run simultaneously even though the channels are different
    2. I tried out single task with two channels included in it. and i used 'channels to Read' property to determine from which ch. i want to acquire data: this method works fine if the sampling rates are same. but if i change the sampling rate of one channel it gets reflected in other channels as well.
    can somebody help me out to solve this problem.
    i will appreciate if somebody can post the sample code as my deadline is approaching
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog

    Hi Dennis Knutson
    Thanks for your suggestion.
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog

  • IIR Filtering and response .vi: Butterwort​h filter magnitude response depends on sampling rate -why?

    Hi folks,
    I am not expert in filter design, only someone applying them, so please can someone help me with an explanation?
    I need to filter very low-frequent signals using a buttherwoth filter 2. or 3. order as bandpass 0.1 to 10 Hz .
    Very relevant amplitudes are BELOW 1 Hz, often below 0.5 Hz but there will be as well relevant amplitudes above 5 Hz to be observed.
    This is fixed and prescribed for the application.
    However, the sampling rate of the measurement system is not prescribed. It may be between say between 30 and 2000 Hz. This will depend on whether the same data set is used for analysing higher frequencies up to 1000 Hz of the same measurement or this is not done by the user and he chooses a lower sampling rate to reduce the file sizes, especially when measuring for longer periods of several weeks.
    To compare the 2nd and 3rd order's magnitude response of the filter I used the example IIR Filtering and response .vi:
    I was very astonished when I the found that the magnitude response is significantly influenced by the SAMPLING RATE I tell the signal generator in this example vi.
    Can you please tell me why - and especially why the 3rd order filter will be worse for the low frequency parts below 1 Hz of the signal. I was told by people experienced with filters that the 3rd oder will distort less the amplitudes which is not at all true for my relevant frequencies below 1 Hz.  
    In the attached png you see 4 screenshots for 2 or 3 order and sampling rate 300 or 1000 Hz to show you the varying magnitude responses without opening labview.
    THANK YOU for your ANSWERS!!!
    chris
    Solved!
    Go to Solution.
    Attachments:
    butterworth-filter-differences.png ‏285 KB

    Hello Lynn,
    thanks for the answer. You are right that there are few points "behind" the curve in the graph, see png.
    However, this is the filter response which Labview (2009) provides to me directly out of the "IIR Filter for 1 Channel. vi" in the "filter information" output cluster. Where up to now I do not know how to influence it - apart from adjusting the input parameters "IIR filter specifications". OK, I assume I have to gain more knowledge of this. The curve of the magnitude resonse dies not change when I change the number of samples of the input signal of the signal generator, only wehn I change the sampling rate.
    I used directly the example vi from Labview with the name indicated in my first post "IIR Filtering and Response.vi".
    So I assumed that everybody has it in his/her examples shipped with LV and it is not necessary to post it.
    I just adjusted the size of the diagram of magnitude response to see the curves better as you see in the attached vi.
    So I did no changes to the vital parts of signal generation and filter of the example. The screenshots are like they come from the example when using the option "one waveform" where I as user assume that this which is behind is quality-controlled by NI.
    I was also astonished that the filter magnitude response is different to the one I copied out of graphs 1 year ago - but I unfortunately cannot reconstruct which example I used there...
    Thanks for any further comments
    chris
    Attachments:
    IIR Filtering and Response_CH.vi ‏55 KB
    butterworth2nd_order_bandpass_0p1to10Hz_mag_response.PNG ‏18 KB

  • High sample rate data acquisition using DAQ and saving data continuously. Also I would like to chunck data into a new file in every 32M

    Hi: 
      I am very new to LabView, so I need some help to come up with an idea that can help me save data continuously in real time. Also I don't want the file to be too big, so I would like to crete a new file in every 32 mega bytes, and clear the previous buffer. Now I have this code can save voltage data to TDMS file, and the sample rate is 2m Hz, so the volume of data increase very fast, and my computer only have 2G ram, so the computer will freeze after 10 seconds I start to collect data. I need some advise from you briliant people.
    Thanks very much I really appreciate that. 
    Solved!
    Go to Solution.
    Attachments:
    hispeedisplayandstorage.vi ‏33 KB

    I am a huge proponent of the Producer/Consumer architecture.  But this is the place I advise against it.  The DAQmx Configure Logging does all of it for you!
    Note: You will want to use a Chart instead of a graph here.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    hispeedisplayandstorage_BD.png ‏36 KB

  • Can't set sample rate 1609

    Hi,
    we've recently upgraded to LV 8.6 and DAQmx 8.7 and then got problem with the data aquisition that uses the DAQmx API. For example, we have a cDAQ-9172 and 9239 AI module. The device could be user configured and a typical configuration could be a continous acq, single sample in 10 Hz. After upgrading the error -200279 "Attempting to read samples that are no longer available ... has been overwritten" has come up soon after the task was started. It turned out that the property SampleClkRate is not affected by the value that is put into the DAQmx Timing.vi, unless it was set > 1612,9, if you set 10,100 or 1000 or whatever the sample rate will still be 1612,9 when you read from the timing property.
    So the buffer then of course becomes overflown, but the question is why there is a minimum sample rate like this? Earlier it was fine to set it an arbitray value and the acquistion would be in that rate.
    There are many solution to get around this (read faster etc.), but it strange that the behaviour of the code can change like this from a version to another...
    /Henrik
    Solved!
    Go to Solution.

    I see one flaw in your program, you have hardware timing and software timing in one loop. The loop is limited by the software wait. (I think this is on purpose for demonstration).
    I have looked at the manual for the 9239 and page 18 notices that hte minimum input rate is 1613kS/s
    So that is explained, the only problem is that the DAQmx timing VI does not return an error or warning when setting a too low rate.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Low sample-rat​e measuremen​ts on the PCI-6115 DAQ card

    I need to measure an analog signal at a sampling rate of a few tens to hundreds of Hz in sync with the rising edge of an external clock. I have a PCI-6115 DAQ card w/ Labview 6.1 and NI-DAQ 6.9.2. The PCI-6115 is a high speed card and has a minimum sample rate of 10 KS/s. Is there any way of implementing a low sampling rate measurement using the PCI-6115 in sync with an external clock?
    Thanks in advance.

    Kuldeep,
    It is possible to do what you are describing above (in fact I don't think an external clock is required to do this), however, bear in mind that the reason for this minimum sampling frequency is due to the ADCs used on this high speed board. The ADCs used are pipelined ADCs, meaning that when a signal is digitized, it is digitized in distinct stages within the ADC (in the case of the 6115, I think there are 3 stages involved). Data is moved from one stage of the ADC to the next each time a sample clock pulse is recieved. If too much time elapses between these clock edges, the signal to be digitized can actually 'leak' off of the ADC. This can result in improper digitization, which can lead to less accurate measurements. So, while it is possible to mak
    e the device sample below it's minimum rate, it may be advisable to sample faster than the rates required by your application, and either average multiple data points per measurement, or throw away extra points taken.
    I hope this helps,
    Dan

  • IPhone: AudioQueue - is it possible to change the sample rate?

    I've been playing around with the AudioQueue stuff for a few days and it's all working fine.
    I was trying to build a low-latency playback system by making the streaming buffers the same size as the audio file and pre-loading the buffers (which works fine) but I've hit a snag.
    I've been trying to get the streaming to work at different sample rates so that I can play back the same sample at different pitches. I managed to do it by modifying the sample rate in the AudioStreamBasicDescription structure but in order to actually make the stream playback at the new rate it seems you have to create a new output, reload the audio file into the buffers and re-enqueue the output queue before starting playback again, otherwise the sample rate change has no effect.
    There is a method to set queue properties; AudoQueueSetProperty() but unfortunately the sample rate Property (kAudioQueueDeviceProperty_SampleRate) is read-only
    Can anyone suggest a way to achieve this with AudioQueue or do I need to move over to OpenAL?
    Thanks,
    Neil

    Dan,
    there is one point in your understanding, which i am not sure what you think about when talking about it: I understand E-series devices do not support this property change while the VI is running.
    infact, you cannot change the sample clock rate during acquisition. but
    this does not mean that you cannot change it while the VI is running.
    you have only to interrupt the acquisition. since you want to acquire
    continuous, this would have the same effect as stopping the vi, i asume.
    so the best way to accomplish this task is to use an external clock.
    this is e.g. often used for acquistion on rotating shafts. the
    acquistionrate is always e.g. 24 points per revolution regardless of
    the rotational speed of the shaft, except for a maximum frequency of
    course.
    Norbert B.
    NI - Germany
    Message Edited by Norbert B on 09-14-2005 04:16 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

Maybe you are looking for

  • My laptop randomly turned off and now it won't turn back on. What do I do now?

    I was just on my laptop like any other regular day but than all of a sudden it turned off. I tried to turn it back on but nothing happen. The battery is full and everything seems normal (except the reason it won't turn on) HELP!

  • Dynamic File name for File receiver adapter

    Hello, I am doing Proxy sender to File receiver scenario. Filename is generated in SAP R/3 program and I want to create the file with this same name on target location. please suggest me how to use this file name in Receiver file adapter?. Thanks & R

  • App Signing Error, Number of Folios Does Not Match the Main Folio File

    Hi All;   I have a 250 page standalone app that I am trying to compile for the Apple Store. I read through the forums and enabled "AppBuilderLoggingEnabled.cfg" in my user directory to capture the issue. Here is the snippet of the log that was create

  • RADIUS Authentication Error Across the Subnet

    Hi Guyz I have configured Microsoft Server 2012 R2 as a RADIUS for Cisco IOS Devices Server IP Address :  10.95.6.12 Router IP Address Fa 0/0.192                    ---->>>    192.193.194.195 Router IP Address Fa 0/0.6                          --->>>

  • How to flashback a tablespace

    hi everyone, i want to know flashback in detail, is it possible to flashback a tablespace and a datafiles, if yes could you please explain me thank you!