Processing acquired data (8 simultaneous channels) in RT host (producer,consumer problem)

Hi Gents,
I have a Crio 9024 and two delta sigma modules NI 9234, I have to acquire 8 cahnnels simultaneously at 51,2 kHz from FPGA and transfert this data via DMA fifo to the RT host for proceesing (FFT for all channels and send data to a host computer via a stream network). I succeed to do this with 25,6KHz as sampling frequency but when I tried with 51,2KHz (my goal) I had problem because in RT code I have a producer loop receiveing data from fpga (DMA fifo) and sending this data to a consumer (Queue) loop in RT also for processing this data but the producer is to fast so the consumer loop can't proccess data in time and the queue is overflow. I have replaced queues with RT fifo,single process variable,... but no luck !!!
Any way how to send 8 channels data from one loop to other for processing (base band FFT N channels) at 51,2KHz ???
Please I need help !!!

DMA Fifo:
To avoid overflow you have to configure the RT side which has a default size of 10000 (Rio4.0 and above 2^14 elements) or doubled FPGA depth (fifo_config)
RT Fifo:
config example
Read data from DMA to RT Fifo
(read all elements available and write this data block to your RT fifo, which is configured to hold n-Blocks of size x, i.e. 300Blocks of 18432elements each)
--> here I suggest to read a multiple of 8, because of your channel count
Read data from RT fifo to stream
(send data blocks to the host where each block is one element in terms of streaming buffer --> configure streaming buffer)
Configuring large RT Fifo's has an impact on memory usage, so have an eye on it.
Screens are just examples (not functional code)
Hope it helps
Christian

Similar Messages

  • How to acquire data through multiple channels in parallel using PXI 6070 E, PXI 4071 and LabVIEW?

    Hi,
    I am using NI LabVIEW, NI PXI 4071, and NI PXI 6070E to measure current through a variable resistance. Now, I am using one channel from SCB-68, but I want to add another channel in parallel so that I can have two resistors instead of one that I cam measure current through them.
    I have attached a Pdf file showing the setup for hardware in use and LabVIEW code also.
    Can anyone look at these files and give me guide lines or ideas that can help me resolving this issue, please.
    Thanks in advance.
    Best Regards,
    Shaheen.
    Solved!
    Go to Solution.
    Attachments:
    IV copy for HS.vi ‏55 KB
    Layout of NI Cards.pdf ‏248 KB

    Your 4071 can only do one measurement at a time. Your DAQ cannot measure resistance either nor has it got any analogue inputs.
    However, you could use a multiplexer and multiplex your 4071 DMM. This wont give you simultaneous measurements but can acquire data one after the other, the speed is obviously dependent on the multiplexer you choose!
    Hope this helps.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • I want to acquire data for multiple channels using PCI 6120 that works on traditional DAQ. I cannot access more than one channel, can someone help me or if someone has data acquisition vi for PCI 6120, please send me over . Thanks

    I have PCI 6120 card and I want to acquire data for more than one channels. I'm using traditional DAQ to get it. But it does not work for more than one channels. If someone has a data acquisition vi for PCI 6120. Or some suggestion how to aquire data please let me know.
    Thanks

    Hello DSPGUY1,
    You can definetly acquire from several channels. For your convenience, I have appended below the content from help that tells you how to configure it:
    "channels specifies the set of analog input channels. The order of the channels in the scan list defines the order in which the channels are scanned during an acquisition. channels is an array of strings. You can use one channel entry per element or specify the entire scan list in a single element, or use any combination of these two methods. If x, y, and z refer to channels, you can specify a list of channels in a single element by separating the individual channels by commas, for example, x,y,z. If x refers to the first channel in a consecutive channel range and y refers to the last channel, yo
    u can specify the range by separating the first and last channels by a colon, for example, x:y."
    Hope this help.
    Serges Lemo
    Applications Engineer
    National Instruments

  • Error when running VI to acquire data from multiple channels

    Hello there, I am currently trying to write a LabVIEW program interfacing with the Agilent 34970A data acquisition unit. Have managed to get seperate VIs to acquire temperature and voltage data and to graph the data. Running them separately is fine.
    However when I try run one after the other, (ie, run temperature acquisition VI, then voltage acquisition VI; or vice versa) the first one runs OK, but upon trying to run the second one I get a VISA error along the lines of "VISA write". When I try to run the first VI again, that one fails to acquire readings as well. Any way I can rectify this problem? (Want to combine the VI's into a single program.) Thanks!

    Hi Laeral:
    You should be able to just open one VISA session then write and read both commands then close the session at the end. This sounds to me like an error that comes from trying to open two VISA sessions to the instrument at the same time. I have attached some very basic LabVIEW VISA code that writes and reads two different commands. Hopefully it will get you started.
    Regards,
    Emilie S.
    Applications Engineer
    National Instruments
    Attachments:
    Basic VISA Example Two Commands.vi ‏39 KB

  • Numerisati​on of Acquired Data and Transformi​ng into Frequency domain to process it with some mathematic​al expression​s

    Hi everyone,
    I've been trying to manage some signal processing stuff, I use mathscript node for it; due to the node, i have to transform the data set into numerical values. Due to my research, i should do my processing in frequency domain.
    I did a VI, but i dont think it will work properly when i will use it with acquired data. The VI in the attachment has four dummy-signal sources, sines, consider these as analog input channels. The main question is actually how to process acquired data with numerical operations. And how to properly transform the time domain series into "numerical" frequency domain array.
    Take a look at the example in the attachment. The other one is mathematical expression of the process.
    Thanks,
    OZGUR
    Attachments:
    sample.vi ‏204 KB
    mathematical.png ‏103 KB

    Motorbreath,
    Here are some examples on how to use LabVIEWs graphcial coding to get things into the Frequency domain:
    https://decibel.ni.com/content/docs/DOC-9981
    http://zone.ni.com/devzone/cda/tut/p/id/13042
    http://zone.ni.com/devzone/cda/tut/p/id/7111
    http://zone.ni.com/devzone/cda/epd/p/id/2904
    But essentially you are going to want to use the FFT VIs
    http://zone.ni.com/devzone/cda/tut/p/id/4278
    http://zone.ni.com/devzone/cda/tut/p/id/4541
    http://zone.ni.com/devzone/cda/tut/p/id/3342
    https://decibel.ni.com/content/docs/DOC-6390
    I hope this gets you going
    Sam S
    Applications Engineer
    National Instruments

  • Acquiring thermocouple data from mutliple channel

    Hi,
    I am developping a temperature measurement data acquisition application (Using the NI-9211). I already managed to acquire data from one channel at a time and plot in on a graph.
    But my final system should allow the user to select from how many channels they want to acquire data, up to  4 channels at the same time. (the NI-9211 got 4 channels).
    Any hint or help on how to do that would be greatly appreciated.
    Thank you

    I tried using the Property Node -> Node name, but with no luck (Can't figure out how to use it properly).
    I included a picture showing how I want my interface to look like. The
    user chooses which channel by checking its corresponding box and the
    graph will only display those checked.
    What is the easiest way to implement it?
    Thanks for your help.
    Attachments:
    Interface.JPG ‏41 KB

  • Conditionally capturing certain data while continuously acquiring data

    In case my question has totally confused you, let me describe the situation, a general one which I'm sure some of you have already tackled.
    Suppose you're acquiring data from several channels (let's say two waveforms). And you only want to capture their amplitudes (Y1, Y2,etc.) when either a button is pushed (i.e., things are steady state, now grab that data) or when something else has changed a certain amount (say their frequency has changed 2 Hz).
    When I say "capture", I simply mean grabbing the data into a separate array of X,Y values for later processing or on-line plotting while still acquiring data.
    Hopefully, this makes sense. Would greatly appreciate any thoughts on this, as it's a
    situation that I seem to run into often.
    All the best, Hunter

    Your use of the terms "Waveforms" and "amplitude" implies a measurement of many samples into one number (for each channel).
    For example, if your signal was pure 100 Hz, 1.000 Volts peak, and you captured a 0.1 second block of that signal, then you would have 10 cycles in the capture buffer, varying from +1V to -1V. You can use the RMS function to turn that block of samples into a number of 0.707, meaning the RMS value is 0.707V (= 1.0 V peak).
    The basic philosophy would be:
    1... Start a continuous acquisition. By specifying NUMBER oF SAMPLES = 0 in the AI-START vi, you will acquire data forever (until the buffer overflows, or until stopped).
    2... Periodically (based on a timer), you ask the AI READ function to read zero samples. This does not remove data, but it does tell you how many samples are in the buffer.
    3... You immediately read that many samples out of the buffer, and convert from volts to engineering units (if appropriate).
    4... If you are measuring their frequency, you need to perform an FFT now. The highest peak in the magnitude of the FFT output is the dominant frequency in the signal. (Freq. of peak = Index of peak * Sample Rate / NPoints in block.
    5... If you are doing FFTs, you get a big speed advantage if your block size is a power of two (128, 256, 512, 1024, etc.). If so, then replace step 3 with *-IF-* backlog >= N (power of 2) then read N points from buffer.
    6... Apply your criteria - *-IF-* the button has been pressed, *-OR-* if the frequency of channel 2 is different, then compute the RMS or peak values and append to your final results array. Otherwise do nothing.
    If you want to detect 2-Hz changes, you need to know the rules of how FFTs work - the frequency resolution is the BIN WIDTH, which equals the sample rate divided by the number of points in the block. If you have a 1000 Hz sample rate and a 1024 point block, your resolution is 1000 / 1024 or just less than 1 Hz. But if you have a 1000 Hz sample rate and a 32 point block, your resolution is 1000 / 32 or about 30 Hz.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Acquiring data from all the analog channels of NI-3202 NODE using a single sensor

    Hi all,
    I would like to know that can i be able to get the data from all the four analog channels of NI-WSN node 3202(analog input node) connecting only single sensor on the analog input and connecting all the remaining analog inputs using wires and also shorting the ground pins corresponding to each analog input pin.
    By configuring the each channels like 0.5 sec delay for every analog channels to acquire data. can we get the sensor data from all the channels by doing this. basically here i am trying to increase the minimum sampling rate of the ni-wsn NODE 3202 which is 1s.
    I this approach is correct or we cannot do this.
    Thanks

    Stefan,
    In terms of differential and RSE, channels 0-8 should default to differential when using test panels.  Differential needs two input channels to function correctly and these channels must be spread apart by 8 channels. (i.e channels 0 and 7 are a differential pair)  Channel 13, on the other hand, will default to rse if chosen as the reading channel because there does not exist another channel that is eight away.  I am not quiet sure if the virtual channels will default channel 5 into being differential but I will check into it.  If it is differential as default then you may run into problems since channel 13 is utilized in both strain gauge reads.   
    "The second question is, if we can also use the "voltage" setting for measuring strain gauges? we did that in the past, using LabView 6.2."
    If you are referring to "voltage" as acquiring a signal with custom voltage with exciation then I would reccomend using example in LabVIEW called Acq Wheatstone Bridge Samples (with Calibration).  This can be found by navigating to LabVIEW's example finder and expanding Hardware Input and Output>>DAQmx>>Analog Measurements>>Strain.
    I have also included some useful links that may provide more insight into the SCC modules as well.  Also, what is the excitation voltage and power that your strain gauges are expecting?
    SCC Tutorial Series: SCC-SG0x
    SCC Example Series: SCC-SG0x
    Using the SCC-SG11 Shunt Calibration Module
    Thanks,
    Gio L.
    Digital Support - Product Manager
    National Instruments

  • Where to put data processing routine when acquiring data using DAQmx

    I have a program that is aquiring data using the DAQmx Acquire N Samples mechanism with automatic reset and a data handler callback routine. DAQmx acquires N samples (usually 1024) from the board, calls the handler to do something with it, and then resets to get the next batch of data. The program acquires a number of lines of data, say 512 lines of N points each, with one callback call per line. Triggering is done by a hardware trigger at the start of each line of data. So far so good.
    The issue is that the time that it can spend in the callback is limited, or else the callback is not finished when the next batch of data is ready to be transferd from the DAQmx buffers and processed. There is a substantial amount of analysis to be done after the entire frame has been acquired, and it ends up taking far longer than the time between lines; so where to put the processing? The data acquisition is started from a control callback callback that exits back to the idle loop after it starts the data acquisition process, so there is no code waiting to execute, to return to, when the data acquisition is finished.
    I could try to put the data analysis routine into an idle-time routine and trigger it with a semaphore, or I could put it into a timer control callback with, say, a 10 millisecond repetition rate and poll a flag, setting the flag when all of the data has been acquired. Any suggestions would be appreciated.

    I would recommend using Thread Safe Queues. Your acquisition callback can place items in the TSQ and then you can process the data in a separate thread. TSQs are nice because they allow you to install a callback function to run for certain events. Most importantly, you can install a callback for the Items in Queue or Queue Size Changed event which will run the callback if a certain number of items are in the queue. This lets you take advantage of multithreading in a simple and safe way using a standard Producer/Consumer architecture. However, you may still run into problems with this architecture if your acquisition thread is running much faster than the consumer thread. You could eventually overflow the queue. In that case, your only options are to either get a faster system, slow down the acquisition or do the data handling post process.
    National Instruments
    Product Support Engineer

  • How to acquire from various AI channels simultaneously with a different range for each one?

    How to acquire from various AI channels simultaneously with a different range for each one?
    In LabView I have found some examples but in C there isn't seem to be any.
    Solved!
    Go to Solution.

    Or you can add channels one by one with individual instructions: the follwing code compile and runs with no errors on a vitual daq device:
    err = DAQmxCreateTask ("", &taskH);
    err = DAQmxCreateAIVoltageChan (taskH, "Dev1/ai0", "AI0", DAQmx_Val_Cfg_Default, -5.0, 5.0, DAQmx_Val_Volts, "");
    err = DAQmxCreateAIVoltageChan (taskH, "Dev1/ai1", "AI1", DAQmx_Val_Cfg_Default, -10.0, 10.0, DAQmx_Val_Volts, "");
    DAQmxStartTask (taskH);
    err = DAQmxReadAnalogF64 (taskH, 5, 10.0, DAQmx_Val_GroupByChannel, val, 10, &read, 0);
    DAQmxClearTask (taskH);
    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?

  • How to transmit counter input data of different channels simultaneously?

    Hello.
    I'm using X-series PCIe-6361 DAQ board which have 8 DMA channels and Labview 8.2.1. I upgraded the version of DAQmx as 9.0 which supports the X-series devices and confirmed the board worked normally on my system.
    I'm trying to measure the pulse width continuously from 4 different pulse trains with CMOS level. The frequencies of signals are same but the pulse width and phase are varying with respect to time.
    http://zone.ni.com/devzone/cda/tut/p/id/9376
    From the tutorial page of NI X-series, I saw the following expression "X Series also includes eight DMA channels to stream data directly
    between the device and PC memory without CPU interaction or additional
    programming effort. These eight channels provide parallel data streams for the analog I/O, digital I/O, and all four counter/timers."
    But when I started the Labview programming, I realized that the counter functions of different channel cannot be put into a single task. So I couldn't help but separate the read functions into 4 individual tasks and there are timing differences in data transmission between channels up to 250 micro-sec because of the sequential running.
    How can I eliminate the timing difference and realize parallel data streams for the counter?

    Check out these links. I hope that they help!
    Fieldpoint and RT
    Logging Data with a FieldPoint FP-20xx to View in a Web Browser
    Transferring Files from a FieldPoint FP-20xx through an FTP Server
    Introduction to Using DataSocket Commands to Communicate with FieldPoint Etherne
    t Network Modules
    Good Luck!
    Mike
    NI

  • How much time do I need to process the data

    Re. my previous question.
    I will be scanning 26 analogue channels at 7 khz into the PCI 6024E using a SCXI 1000 with an 1100 temperature module and the voltage signals going into the 1180 direct feedthrough.
    I would like to acquire up to 3 seconds of data at 7 khz on all 26 channels. I then would 'decimate' the 20 thermocouple channels down to a sample rate of about 700 hz from 7 khz and then display the temperature profiles on a chart and then write the data to disk for all 20 channels writing only the reduced number of samples for each channel.
    Two of the 7 khz inputs I would do an RMS calculation on and then display the results and also write the results of the RMS to a different file.
    The program then needs to
    be ready to sample new data again for three seconds.
    The computer is a P3 500 MHz with 327 MB ram.
    Another part of the question would be suggestions about how to write the program so that we could be sampling new data while the program is processing the old data and writing to disk.

    Hello mhtl,
    If your question is how long will it take to process the tasks you mentioned, there's really no way to tell. This not only depends on the machine, but how you implement it. Certainly, tasks such as this are possible. In fact, we have a good example program that shows you a good structure using threads and queues.
    Running Multiple Tasks in LabVIEW
    (Make sure you select the "advanced" VI inside the llb file.) This example puts the three tasks, acquire, analyze, and present into three separate threads so that they are all acting simultaneously. (Which I believe was your question.) In your "analyze" V
    I, you could be processing your data while the "show data" VI is simultaneously writing previous data to file. There is a good tutorial linked to the page I mentioned above as well. This topic is also covered in our LabVIEW Advanced training course if you're interested.
    I hope this helps!
    Russell
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • 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

  • SaveToFile example modificati​on to get data from two channels simultaneo​usly.

    We are trying to modify the “SaveToFile” example for C++. This particular example comes with NI-scope 2.9.1 and some other versions. This example collects data from one channel and saves the output as a text file. Also, we are using NI PCI-5112 DAQ.
    However, it can be modified to get data from channel 0 and channel 1 at the same time. There is a help file called “Fetching Multiple-Record Acquisitions”, which is under the NI-High speed digitizer help topics. This confirms that you can modify the code to get data from two channels and the output will be a text file where every other value is from one channel. This help file also gives some code. However, it is not very much helpful to us, please keep in mind that we have only taken a basic course in C++.
    Our project is to analyze the data, however, we need to acquire the data before we can analyze. We have spent so much time trying to get the data.  What we need to do is get data from both channels simultaneously and output the data as a text file.
    Can anyone help us to modify the code so it can get data from both channels simultaneously? Or can anyone help as where we can get more information? Or does anyone know of any sample examples that will take data from two channels simultaneously and output the data as a text file or any other type of document.
    Any help will be really appreciated, as we have spent so much time trying to acquire the data.
    Thanks.

    Hi Finomad,
    Please see this post for an answer to your question.
    Regards,
    Natasa

  • How to acquire data from multiple dataports at the same time

    Hi,
    I studied the multithreading section of Labview, but still have no idea
    how to make it work. Let me briefly explain my situation. I need to
    develop a program that can control and acquire data from 4 serial
    ports. I have 4 buttons to control starting or stopping acquisation
    from the corresponding port. Every acquisation process is a while loop.
    How can I start a new acquisation loop (eg. from COM2) while the loop
    for COM1 is still running? In other words, I wish the 4 loops running
    independently, and are controlled by their corresponding buttons only.
    Thanks for any suggestion.
    Jin

    Hi Anonymous,
          If I were you, I'd create one VI (call it Port.vi) to listen to one port - then make it reentrant.  Drop 4 copies of Port.vi on your Main diagram.  Port.vi inputs could include a VISA reference, a "Start/Stop" notifier and maybe a "Quit" occurance.  Wire to each copy of Port.vi a unique VISA reference and a unique "Start/Stop" [boolean] notifier - let all the copies share the same Quit Occurance.
    In Main, have one event case for each of your stop buttons.  When a button is pressed, send the appropriate Start/Stop notifier!
    ... of course you could accomplish the same thing with four identical loops right in your main diagram, but the more complex the port-handling gets, the easier it will be to manage in one place instead of four.
    Cheers!
    When they give imbeciles handicap-parking, I won't have so far to walk!

Maybe you are looking for

  • It takes forever to delete junk mail one message at a time. What to do?

    How can I delete my junk mail all at once?  This one at a time method is unacceptable to me. Too many junk emails;too little time.

  • How to export in exact same quality file when uploding for youtube?

    Hello Im writing here cause im really tired of exporting dozens of files with bad quality even though im using best exporting settings. I tried to watch tutorial clips where people show how to make best quality but still i cant get it right.....i rea

  • Synchronizing sound and image for splash screen.

    Hello all, I have a peculiar request. ... I have a sound file (about 137KB) and an animated gif (about 134KB). I would like to use this as my splash window before my app starts up. I know how to load these 2 to a screen but my problem is how do I syn

  • Lion update 10.7.4

    I just installed the subject update, 10.7.4.  My computer, a Mac Book Pro, seems to take an abnormally long time to "boot".  It's reminding me a lot of windows.

  • Audio problem-posted again

    I have a MacBook Pro running OS 10.5.6, dual core intel chip, 4 G ram. We are working with AVCHD footage from a Panasonic AG-HMC150. We Log and Capture with ProRes material shot in 1080i. It edits fine, but when I use the L key to search faster than