Slow loop with DAQmx read

Hello

I'm reading 8 channels at once using the NI9213 and DAQmx (see attached image). With this configuration, the loop takes ~ 500ms each iteration. What can I do to improve this?

Thank you

JP

You have not coded anywhere, anytime, so it runs at default speeds.  Look at the examples DAQmx as Thermocouple - continuous Input.vi.  Your module even has a mode high speed, that you can use for a very fast acquisition.  Read the manual.

BTW, the wires DO NOT your mistake byte of WILL in the end to end eventually.  Always connect them so you can control the errors during debugging.

Tags: NI Software

Similar Questions

  • Is it time stamp with daqmx read

    Hi all

    Simple question.  I have currently not creating a task or starting a task, I simply create a channel and reading that chanel.

    It is...  Why I don't get a timestamp when you do and do I create a task to get one of this?

    There is a timestamp when you use the DAQ Assistant or when you choose to return a data type of waveform with DAQmx Read.

    You can't do a reading without a blemish. You don't have to create the task in MAX, however.

  • Repeat the Scans with DAQmx read/write

    Hello:

    I use DAQmx vi to generate signals on channels ao0/1 a reading of the signals of the channels ai0/1 a card NI USB DAQ of 6251. I do this by using the read and write of vi and a trigger vi. This vi will run successfully for a single analysis. Now, I need to be able to perform multiple scans with the same settings but separated by 5 seconds or more. When I click on Scan, the vi analysis. However, when I click scan again once it does nothing and I don't know how to scan again.

    The vi VU RAMP MOD (not included) is simply used to generate the shape of the signal.

    Thank you!


  • Problem DAQmx Read or PDM

    Hello

    Recently, I changed a series of Structures of cases in a more efficient Structure of the event. However, I'm no longer able to acquire the 4 analog inputs (OR-USB6251) terminals voltage signals with DAQmx Read and store them in a TDMS files. The code responsible for this task 8 ('start running Scan') is the event of the attached code structure.

    At first I thought I was calculating the 'timeout' or 'number of samples per ch' incorrectly. However, even when I put them to contant, great values DAQmx Read doesn't seem to work and as soon as the program TDMS files Viewer is empty. One thing I didn't change was moving TDMS close in the Structure of the event when he was outside of the big loop previously. Could this be doing me wrong?

    Alfredo

    Hello Alfredo.

    Of course you have a lot of code here.  When you close the TDMS reference in your loop, the next iteration of the loop will be an invalid reference and so nothing will be written to file.  Be sure to always close your references outside of your loops.

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

  • 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

  • Win 7 slow start - connection with fingerprint reader

    Hello

    I have a T400s (2.4 GHz and 4 GB) with an Intel SSD and WIn 7 RTM with the last drivers beta of Lenovo.

    I have the fingerprint reader enabled for the connection and my startup time of 35 seconds is now shared almost half in the connection of fingerprints and the other half in the rest of the startup procedure.

    Or (the finger) described another way if the machine is turned off and I slide my finger to start the machine, it takes about 17 seconds before the fast logon is indicated.

    Then the machine says 'pending' for 15-20 seconds during which my personal connection icon is flashing by until it ends the connection and almost immediately displays the desktop.

    I am surprised by the very slow connection with my finger already slipped. It would be much faster to turn off fingerprint reader and connect using a password. Someone had this problem and knows how to fix?

    Other problems with the boot, I found (and fixed) is the use of a solid as the Windows background color which, for some reason, costs about 15 seconds at boot time! I also had to reflash the firmware of my SSD to win 10 extra seconds at the beginning of the startup procedure.

    Carpet

    Hello again,

    Sometimes I had to wait several seconds after sliding my finger, to the process of connection of kick. I checked the event viewer on my thinkpad T400 and found the security processes that are at work when loggin. I have excluded them from protection against viruses (Microsoft Security Essentials) and restarted the computer. When the logon screen appeared, I spent my finger and boom, the connection process began immediately.

    Excluded processes are:

    C:\Windows\System32\LogonUI.exe

    C:\Windows\System32\winlogon.exe

    JES

  • Reading data from a queue - store quick loop, slow loop display

    Here's my BD below.  I'm data queues in a loop faster (100 ms or 50 ms) and by sending this data to a loop of 250 ms.  I need to be able to view the data in the slower loop (so that the public Service only is updated every 50 ms).

    Problem I have: How can I dump the data?  It builds and builds, and finally I'm looking at a chart that contains data that is old in 1 minute.  I tried to write my own code RAS (attached).  I tried to use variables to pass data and use a table to analyze... does not.  Any help would be appreciated.

    If you need all the data into the table, I use the RAS queue and write on the Blackboard in a loop FOR (autoindexing with the array of items in the queue RAS).  You can set the front reporter Panel updated before the loop FOR and reset it after, but I don't know who's going to buy you a lot.

  • Selection of a subset of channels to read with DAQmx

    Hello

    I use a 32 channel NI9205 analog input module, connected with the chassis OR cDAQ-9174 and LABVIEW 2011.

    I created a task in the measurement and Automation Explorer who has 16 analog input of virtual channels (each of them with her has an entry configuration, scale, calibration, etc...). Inside LABVIEW, I opened this task to acquire some data, but I just want to read some of the 16 channels (defined by the user), not all, so before the "time DAQmx", I put a 'DAQmx reading node' and I put the ChannelsToRead with the names of the channels that I want to read. It seems to work, but when I put the acquisition rate it's error.

    The acquire module supports a rate of 250 kHz (divided by each channel). So if I put 5 channels to read, for example, it should work with a rate of up to 50 kHz. But whenever I try to use an acquisition rate higher than 15 625 kHz (which is 250 kHz/16) I get an error that says that the maximum rate is 15, 625kHz. As if I was using 16 channels of the task, but I'm not...

    Here the screenshot of channels read and sync configuration.

    Thank you
    Alexander

    Hello Alexander, and welcome to the forums,

    As odessy27 says that you do not reach the correct sample rate because the task is to be set up to read 16 channels; in spite of you more later by specifying which channels are to read.

    To preserve the configuration settings of your created able task and Automation Explorer (MAX), I recommend creating global chains of these. A Global channel will store your configuration for each physical channel and can be accessed from multiple tasks

    Creating a Global channel by the physical channels in your task of MAX right-clicking and then selecting create Global Channel. .

    You can drag these through to your block diagram and wire in the task/channels in the terminal of a function of mx-acquisition of data, as shown in the image below.

    If you change to a control by right clicking > change control channels can be set by the user and the maximum purchase price will go as planned.

    Concerning

    Jamie

  • Slow parallel with DAQ loops

    Hello guys,.

    I decided to make new thread on very strange problem with the DAQ assistant in one of my loop. There is something wrong with my deffinatelly program, but I have no idea what it is. So I think that my program is really usual and often used. So I have two separate while loops in my program, one is empty in my other one is assistant DAQ. In the DAQ assistant, I want 1 sample on request, I tried this for inputs, the outputs of digital signals and the inputs and outputs of analog signal also. If I start the program, the loop with the DAQ assistant is very slow, I measured it, and it will take at least 3 seconds to make a circle. But when I stop the empty loop, thet loop with the wizard DAQ make a circle by 25ms. So I wonder is this a normal behavior or is it som problem? I use this NI USB-6229, LabView 2010 and Windows XP. Photo of measures are attached.

    (slow.png two loops are runnging, fast.png single loop with data acquisition is running)

    Try to insert a wait of 1 ms in the empty loop.

    The reason for what you see, is that the empty loop uses ALL the CPU power to run, leaving almost no power left for the acquisition of data, or for windows.
    You should NEVER make a loop without protected by a sort of waiting in the loop. Still a little wait will allow windows run another task on the pc that must run.

  • 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

  • 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

  • analog parallel DAQmx reads at different rates of acquisition

    I'm running two 9172 chassis with a total of 11 modules. I have two 9217 modules for reading RTDs and a 9205 for sensors of reading level. I've set up three spots, one for each module.
    If I do a task sheet and place DAQmx Read in a loop, I can read all the data without problem, but the three tasks take 4.59 seconds per iteration (reading the RTD is seems to be slower). I need to update the level readings more Rapids, but if I do two parallel loops, try to read the RTD in a loop (two tasks) and the level in its own loop sensors I get an error that the resource is not available - apparently only one instance of DAQmx Read can be called both.
    Is there a work around for this?

    thanx
    lmd2

    Larry,

    Your problems are all related to the task that is described in the manual DAQmx State model.  Each 9172 chassis can have 1 HAVE task that runs at a given time.  If you try to start a second task, you will get an error.  When you use the loop FOR your code is starting and collapses of each task in order that takes a lot of time and explains the 4.59 seconds.  Ideal for config and start tasks in an init State and then begins to acquire data.  The only thing left to do is to release the input/output by stopping and disabling tasks when you did.

    One way to solve this problem would be to install two RTD modules in a single chassis and all 9205 modules in other chassis.  Another way would be to oversample of RTD and process the additional data later.

  • With a sampling of the data with DAQMX, error-200279 occurs when making 2d array dbl

    Hello

    I did a system of simple analog voltage with DAQMX data acquisition.

    It is made for reading of capacitance, where output capacitance value out of a circuit in the periodic voltage signal.

    What I want is to get data from four capacitors simultaneously through four channels, using samples n n (dbl 2d).

    The structure of my VI is almost similar with examples of continuous sampling of voltage in LabView, with the exception of a few other calculations in the loop.

    And for the synchronization of the trigger, I've corrected the edge of release with the external signal from the capacitance reading circuit.

    Version no. 1 has a channel for data input voltage. Version n ° 2 has four channels for the input data.

    While ver.1 can get accurate reading of four capacitors circuit data each (a single channel at a time),.

    ver.2 acquires four channels of data, with a single thin data channel, all the others were wrong.

    I saw a 200279 error occur in the DAQMX read part 2d dbl, so I tried increasing the buffers by changing the sampling frequency or the number of samples, but it wasn't everything.

    I rose for most of the forums with the 200279 error, but the solution would not work on mine.

    Anyone can find the problem? I will attach my screws it may include a bit of Korean language, but most of them are in English, shouldn't be too hard to recognize. Sorry for the inconvenience.

    Oh I forgot, my DAQ is NI USB-6259, and it works in Win XP sp3 and LabView 8.6.

    Thank you.

    Hello Azurenight,

    The 6259 is a DAQ card of the M Series Multiplexed, which means that it is not possible to sample each signal at the same instant, rather the channels are all sent through the ADC even and must be sampled in order. More information on this can be found here:

    LabVIEW Help: Multiplexing compared with simultaneous sampling

    http://zone.NI.com/reference/en-XX/help/370466W-01/mxcncpts/multisimulsamp/

    It may still be possible to get the data you need with the card you have - could you give more information about the maximum eligible period between samples on different channels?

    If you require * real * simultaneous sampling, you will probably need different hardware.

    Kind regards

  • Medium-sized dynamic data analog input read DAQmx read

    Hi, I'm new to labview. Is there an easy way to index using the dynamics of data returned by a readout DAQmx x samples to calculate a moving average? My thought was to read the analog input for X samples pump with the data in another loop through the data, but I can't quite understand how index using the returned data set to extract the measurement value double returned for each sample.

    Any ideas on that?

    Thank you...

    If you get a type of waveform data, why did you ask on dynamic data? No, of course not would you use the conversion of dynamic data on a waveform.

    If you want only one channel, then your DAQmx Read could be changed to 1Chan NSamp. If your channel list only has one channel, you will get a table 1 d with a single element that can be indexed. To get the average of a waveform use the statistical function with the waveform. You use the average Point by Point, and not the average function that has a table for an entry.

    Make sure you always have context-sensitive help on. You can avoid many of these rookie mistakes simple.

Maybe you are looking for