Why is the DAQmx Read VI so slow?

Hello everyone.

I'm using Labview 8.5.1. and NI-DAQmx 8.6 and I wonder what is actually done the DAQmx Read VI.

I want to measure is a signal of 1 kHz. To do this, I use a similar to the attached VI (a pulse signal of 1 kHz is used to trigger and sample clock).

Time the DAQmx Read VI must perform is longer than the acquisition time you would expect 250ms (rather 100ms to measure 100 samples at 1 kHz, time is usually around 350 ms, 1000 samples is ~ 1250 ms). The time depends not on the number of channels in the task.

So my question is what happens when the reading DAQmx VI is called. What I want is: wait next trigger signal, and then acquire the number specified samples, then read buffers samples and return them. Is it possible to force this behavior?

Thank you very much for your replies, I appreciate any help!

Rene,

For your application and hardware, you should use DAQmx controls Task.vi to commit your task before your loop.  Inside the loop, and then you had to play/start/stop the task.  DAQmx uses a state machine to Control Panel tasks and run time.  As writes, when you cal DAQmx Read, DAQmx will see that you have a task that has never been configured.  Therefore, it will look at all the settings that you make on the task, check their accuracy, all the necessary resources book, write the hardware configuration, and then start your task.  Once the specified data has been read, it will relax this state machine to put the task in a State not configured.  Therefore, every time call you Read, DAQmx if through all state transitions.  If you commit your task before the loop, DAQmx would not re - check your settings or need material to re - schedule each passage in your loop.  That being said, there will still be some time adding every iteration of the loop where you must stop and restart your task and meanwhile you can miss a trigger.

If it is really not acceptable for you to miss a trigger, you might consider adopting a design in which read you continuous data and then use release to follow the relevant sections of the data.  Another alternative would be to look at DAQ hardware X series line, because these devices trigger support in hardware (that is to say... They may retrigger unless you need to stop and restart your task).

Hope that helps,

Dan

Tags: NI Software

Similar Questions

  • Error 200088 using the DAQmx reading VI in a case structure

    Main problem: I'm writing a VI that will read data from a data acquisition and write to a text file when I hit a button "registration". To do this, I use the VI of reading DAQmx in a while loop, which is located in a case statement (I hit the 'Save' button for the case of true), which is in another while loop. My DAQmx create Virtual channels screws are outside of the loop, so a wire goes through three structures to connect these screws to the VI DAQmx Read.

    After clicking on 'Save', my VI works until I hit the "Stop" button, how I get error 200088: ' specified is not valid or does not exist. " If anyone can help me get rid of this error, that would be greatly appreciated!

    I enclose my VI and an image of the error.

    Secondary problem: currently, I use two different DAQmx read live: one mentioned above, which lays down: after clicking 'Save' and the other who reads data continuously to display on maps. I want to combine these two, but I don't know if this is possible given the case statement.

    Thank you!

    Hi Alexwright,

    I made some quick changes to demonstrate the producer consumer loop that would be effective in your case. You want to loop of producer in the first while loop so that you use and the same closing DAQmx task. Moving a forwardthis will require some trial and effective change for your application. Please also make sure you use our debugging tools: http://www.ni.com/gettingstarted/labviewbasics/debug.htm.

    I hope this helps.

  • Why is the adobe reader software store my documents, I want to only read and when I tried to save I do it myself?

    could someone explain to me why adobe reader software automatically store my documents instead of just read and save when I wanted?

    Ok. It could be a number of things. Either you must configure your browser so that it opens pdf files using the plugin player who here are the patches: using Acrobat | Display PDF in browser. DC to Acrobat, Acrobat Reader DC

    Or, you use Google Chrome, which has no solution for the moment.

  • Why is the last Thunderbird on Fedora slow 22, 100% cpu?

    Hello

    I've updated my Fedora 22 using dnf today, and now it's suddenly very slow using thunderbird (38.0.1). You reply to a mail of the results in a significant delay in opening a window, then a further delay of filling with the previous mail and then it takes forever for strikes to appear in the message window.

    Deactivation of the modules does not help.

    Take a look in the activity monitor on the Tools menu and see if he is mired indexing.

  • Why is the FPGA Compiler server so slow?

    FPGA Cloud compiler is faster because NO servers are performing, right?
    Well, my Windows 7 PC is powerful, but no luck there!

    Total CPU utilization is never more than 25% and the total memory (including other applications) usage is less than 16%.
    Why, the compile Server uses all available resources? has been restricted?
    How can I leverage more power from my PC?

    If servers OR compile faster code, there must be a plausible explanation / reason?
    Please indicate, how to make the compile server running faster in place?

    I don't know what machines compilation cloud service works, but I do not.

    It seems that the compilation is much faster on a Linux machine on a Windows machine (I think I've heard up to 30% faster). The Linux FPGA compile server is available for LV2012. Set up a Linux machine with a clock high enough CPU and RAM speed and you will get on the fastest possible compilation with current tools.

  • Why is the order of 100 times slower than ibrsp with driver vs 1.7 2.3?



  • Why DAQmx read 200714 error when you save the file?

    In particular vi that I created, I have 3 analog inputs coming in and are graphically represented.  If I choose to save the information to a file, a dialog box appears and I can choose what to save it under.  If I take too long to save the file (aka about 8-10 seconds if the sample read rate is 500/s) then I get this error once the file has been saved:

    Error-200714 occurred at .vi DAQmx Read (analog 1-d NChan DBL 1Samp)
    Possible reasons:
    Acquisition stopped because the driver could not transfer the data from the device to the computer's memory rather quickly. This was due to limitations of the computer system.
    Reduce your sample clock rate, the number of channels in the task, or the number of programs on your computer that is running simultaneously.

    Why the DAQmx bed vi I have this problem when the vi has been idle for 10 seconds then I choose where to save the file?  How can I fix this error?

    Hi child of pre-school age,

    I think your error might be caused by the read buffer overflow. my suggestions for you would be to either the following four ideas:

    1. stop the acquisition before writing the file. This should mean that the DAQmx Read function will no longer be reading and therefore does not generate an error.

    2. If you still want to read the data but also write data as well, I think you'd be best suited for use live TDMS. TDMS allows the user to stream to a reading of filewhilst.

    3. the configuration backup dialog box file before starting the acquisition. Download the user to enter all data in the file before you start to acquire.

    4. change the buffer to unlimited so that you have enough time to navigate the record window.

    If you send your VI I can advise others

    Let me know how you go,

  • What is READ the array returned by the DAQmx meter? How can I know the two functions DAQmx READ data stream in the same WHILE loop?

    I have a question about the order of execution.  In the WHILE loop, I have two things to measure, period and tension using the DAQmx READ functions for voltage and the meter.  In the end, I want to collect these data as points almost simultaneously as possible, as a pair and then send them together to another piece of code (not shown here) which them will result in some sort of command for an engine.  It would be run, and then I want to perceive the tension and the period at a time later and do the same thing.

    (1.) I'm a little confused on what the meter of the READ function is back because it's a table.  What is a picture of?  I thought that it was up to the value of the individual periods between rising edges.  The output of the counter 1 DBL d's a table. How many elements in this table, and what determines the size of this table?  Are the elements of the array the individual delays between the edges?  How many values are stored in the array by executing?   We take the AVERAGE of the last 15 items, but do not know if we are throwing some of the data or what.  How to understand the composition of this painting?  How can I change the composition of this painting?  Is it possible to measure only one period at a time, for example the time between TWO edges?

    2.) Will this WHILE loop execute as it gathers tension and a "period table ' (remains to be understood by me) by TIME running in a loop?  In particular, we want that the value of the tension associated with the value of the AVERAGE of the period "array", so we can use two data items to create orders of next control every time that the two values are reported.  The structure for the delivery of vi will be attached data in pairs like this?  I understand that one of the READING functions run not before the other function of READING in the WHILE loop.  I want that the period "means" and "strain (Volt) collected at the same pace. This vi will he?

    Thank you

    Dave

    Hi David,

    I suggest including the DAQmx Start Task function. If it does not start before the loop, it starts the loop and work very well, but it is not as fast and efficient. In the model of task status, task wiill go to run the checked each iteration of the loop and then back the time checked running when it restarts.

    The status of the task model: http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/

    Kind regards

    Jason D

    Technical sales engineer

    National Instruments

  • DAQmx read slowly measurement

    I am still fairly new to LabView, only it uses about 5 months, so bear with me.

    I'm trying to understand why the DAQmx playback function runs slower I expect.  I use a PCIe-6363 map connected to two BNC-2110 connector blocks.  I run the attached code (Position AOM control_prod_cons) and producer while the loop takes about 14 ms to execute.  Here's why this is a question:

    The Subvi belongs to a larger structure that we use in our research lab to run our system of construction craft nanofabrication.  You are using a computer-controlled turntable (wise move task), monitors of reading of the scene (spot monitor sensor) sensor and control a shutter that controls power to the sample (Subvi with lightning) laser.  Up to 4 outputs analog and three analog inputs.  The scene is being ordered to move in 5 steps of nanometer to a speed of 50 micrometers per second, a rate of analog output of 10,000 samples per second per channel (3 of them).  The shutter has a rate much more low yield, at most 5 samples per second.  Our goal is to synchronize the movement of the scene with the shutter, and so we must read the exact position of the scene using the analog inputs, one for each axis, x, y and z, vote as often as possible, even if in reality it didn't need to be more than one read each ms.

    AOM control_prod_cons position takes two points in space that we wish to move between two points where the shutter must open/close.  The first image in the flat sequence did some vector calculations to get the line that we write out the origin of the octant where x, y and z be positive by adding or subtracting, then making reflections around axes, if necessary.  The end of x, y and z values (which are now all positive) are summed and placed later in the sequence.  Coordinated sensor monitor are then read in (loop producer) and turn the same way coordinates the target have been transformed (consumer loop), then compared with the values of (x + y + z) end and start (0) and adjusted accordingly shutter. (For troubleshooting purposes, "off" is 2.5 and read the text file we entered to extract structure).

    All the tests I've done so now tell me that the loop of the producer is the rate limiting step.  For a line that is 30 microns long, with the displacement of scene I described above, I was 45 or 46 readings, that works on a read (on the three channels) once all the ~ 14 ms, or only 72 samples per second per channel, which is * very * slow for the card and is not acceptable for our application.  Am I missing something?  Why the producer loop takes 14 ms per iteration?  I tried to reduce the sampling frequency of writing to 1000 samples per second per channel, but that did not alter the reading rate, so I'm not sure I can cela pins on the map.

    I ran the DAQmx read function as a NChannel 1sample, read in a while loop like I do in more complicated VI, reading of the three analog inputs in a very simple VI who only reads the sensor monitors and nothing else and the reading rate was 2750 samples per channel (read 5000 samples through three channels in 1800 ms) , so I know that the card can read that fast.

    I've also attached the highest lying VI that sets up the physical channels for adding information.  I am also attaching a VI where the producer/consumer framework is not used.  Also, this while loop took ~ 14 ms to exploit.

    Sorry, that was so verbose, just try to do what I'm trying to erase.  If you have any other questions, please just ask.  Thanks in advance for your help.

    Well I'll be darn.  The "task AO is?" query seems to be the culprit.  I have no memory of being always aware that there was such an expensive application.  I don't know if I tried to make such a request in a tight loop before, but I'm a little surprised by the fact that I'm surprised.  I don't know if anything is changed, but in case it's a secondary-ish effect, I use the new DAQmx 16.0

    Another approach would be to use a property DAQmx writing node to query the Total number of the samples.  It seems quite a bit faster.

    -Kevin P

  • What are the units of the DAQmx meter?

    Hello

    I created this VI and several others like it, a few months ago, but I forgot some of what I have at the time.  I believe that this VI should measure period, using the counter on the chassis of the acquisition of data.  Can someone tell me the units of the measurement period?  I think it's seconds, but I am trying to find a way to understand this!  The period values are generated by the DAQmx READ function in the WHILE loop.  What units that work out in the table?  What are the units of the elements of the array, essentially?  See the attached VI.

    In addition, how do you know?  I opened the DETAILED HELP for the DAQmx Read (minimum 1 D NSamp DBL) shows the VI but, I can't find anything on the units of data coming out of the Terminal marked data with the orange wire, which is actually an array of periods, and we take the average of the most recent measures period 15 or more.

    I had a suggestion months ago for a line OR manual containing a description of the measures of buffering EdgeCounting, but when I went to find it, the link had been changed by NEITHER, so I find that manual, but I think the answer is probably there because I remember this manual is very helpful when I've done it before.

    Thanks for the tips.

    HI dav2010,

    When you create a virtual channel, you must specify the units of the task of counter uses.  There are several options that are listed in help here:

    http://zone.NI.com/reference/en-XX/help/370469AA-01/lvdaqmx/mxcreatechannel/#DAQmxCreateChannel%28CI...

    I'm not on a computer with LabVIEW now, but I think the default should be ticks, which is the number of ticks the time base of your device.  You can find this information in your hardware specifications.

    Kind regards

  • Problem DAQmx read True False

    Hello

    I use DAQmx Write (Bool digital 1Line 1 point) to send a Boolean sample to a digital output channel.  I want to be able to tell if the signal is strong or weak, so I use DAQmx Read (Bool digital 1Line 1 point) to take up the task as input and then plug a light at the end of data.  The problem is the light lights up when I pass False to the VI DAQmx writing and does not shine when I pass the value true to the writing DAQmx VI.  Shouldn't the DAQMx Read VI be output Boolean even as input to the VI DAQmx writing?  In others, should I not get a true reading VI DAQmx if I pass a real in the DAQmx writing VI and even for a case of false?

    See code attached for simplified example of what I'm trying to do.

    Thank you

    Jason

    Which would make sense if the channel is configured as an open collector output.  This would mean that the line is retrieved when you write a REAL low and left floating when you write a FAKE.

  • DAQmx Read is limited to 9 digital channels?

    I'm reading several digital channels with DAQmx Read (Digital 1-d Wfm NChan NSamp). The output of the DAQmx Read vi is a table 1 d of digital waveforms. If I put this output through Cluster in the cluster that results seems to be limited to 9 elements, data [0] through data [8]. DAQmx Read output is limited to 9 digital waveforms? I'm using Labview 2009.

    No, this is not done, is choosing the Cluster size. Nine is the default value. Right-click on it to change.

    Because you have to change it every time you change the number of channels, are you sure want to use clusters instead of just working with a table?

  • Comments are negative for El Capitan, freezing, email fails, tough screen fonts to read.performance very slow. Why install it?

    Comments are negative for El Capitan, freezing, email fails, tough screen fonts to read and very slow performance.

    Why install it?

    Why Apple is not read these comments and 'Fix' the questions?

    Because they are nonsense

  • USB6363 DAQmx (reading and writing) calendar seems slower than other similar USB DAQ devices

    Hey people,

    I have currently a service waiting number with OR the subject, but I thought I'd post up incase anyone has ever dealt with a similar question pertaining to USB DAQ hardware.

    Try to understand why there is a difference of synchronization between the 6363 USB and some of the other less expensive USB devices like the 6525 or 6501.

    It's a watered the actual code that my team has noticed this difference in the simplified version.  The actual code is a reading analog daqmx (it's triggered hw, so we begin the task of analog playback, trigger, wait the time we acquire to and then run reading daqmx. who takes 6 ms to read a single 50 values of the buffer).

    Thank you

    -Pat

    Hi Pat,

    Try benchmarking of HAVE it read that way (with the wait timed by the software, it seems to me that the task is probably not yet made to the time you want to read - I guess that the question is relative between the event of the task performed and all the data is available in the DAQmx buffer, I don't have a series of X USB to see) :

    Try benchmarking your writing clocked by the software in this way (there no reason to include the check/reserve/validation/start sequence in your writing of reference when the task can easily be launched during initialization of your program):

    On my PCIe X Series as the two cases take< 1="">

    Best regards

  • DAQmx Read simultaneous calls on the same digital line

    Hi all

    I use v10.0 LV 32-bit on Windows 7.

    I use DAQmx Read (in a task) to check the value of a digital line. Is it OK to do this in two different locations in a program at the same time for the same digital line? Or I have to put a wrapper around reading to force operations to be sequential?

    Thank you
    Zola

    When you need to expose the capabilities of resources to multiple areas within a project (expand the scope of a resource) it is common to wrap the resource in an Action engine to encapsulate the resource functions. See here for an example of a 'Module on resources' material and a discussion animated about how this code help development construction and avoid resource conflicts.  If you have not read famous nugget again – he of Ben is a link in my tag "Required_Reading".

    Or more directly.  Yes, you should encapsulate these readings DAQ to avoid suspended

Maybe you are looking for