DAQ read loop with finite samples

Hello

I would like to acquire the data of the instrument with a 6024E Board then put the peaks and which repeat at the highest frequency possible. The task of data acquisition is configured for sampling finished using a trigger, generated by the instrument (55 Hz) signal.  When I use a VI such as demo_v1 (see below) everything works well but it takes about 200ms, just for the lu DAQmx VI to run.

It seems that begin the task outside of the loop (see demo_v2) helps reduce acquisition time, but it no longer works with over sampling. If I configure the task of sampling in continuous synchronization with the trigger of the instrument is lost.

How can I solve this problem?

Bernard

OK, thanks for the clarification.

Another clue would be to use WAS redeclenchables, which means that you combine a Counter task - that is redeclenchables - in order to generate a sample for your Acquisition of AI clock. For example a trigger of your instrument happens every time you take exactly 100 samples with the clock generated by the task of counter.

Christian

Tags: NI Software

Similar Questions

  • DAQmx task Read DAQmx with sampling frequency of 10 Hz produced much too much data

    I have a simple configuration with a strain of channel 4 OR-9237 amp holds a carrier of series C of WLS - 9163 (wired ethernet mode) - Details probably does not matter.

    I used MAX to create a DAQmx task associated with which all four gauges samples.  The calendar setting is "Scan Loads" is continuous sampling, 2 k buffer (read samples) and 10 Hz rate.  I guess that this task would generate 40 data values per second - 10 for each channel.

    I have a simple loop of reading using DAQmx Read.vi that works always (without any stimulation time).  Playback is set to read all available data and then pump it into a table.
    In the attached example, I also added a few words of debugging to stop the loop after N iterations.

    As the loop is programmed with a 0.2 second period, I expect each pass of the loop to read about 8 samples or 2 samples per sensor.  Instead, I get hundreds each passage.  It's like reading has substituted the sampling frequency specified in the task of the unit.  I absolutely need data to be material to the rhythm.

    Where have I lost?

    Thanks Adnan,

    I changed your example I selected 'Strain gage' entry analog and then lowered the minimum and maximum thresholds to +-1-2.  What happens is that each other in the loop, I 2048 samples or zero samples.  The display flashes a whole line and then it clears any other past.

    In response to your second post, I understand that the loop cannot run quite right that I select.  I think that, but at a sampling frequency of 10 Hz, I have to sleep on the software side for nearly a minute before I built 2 K samples.

    I played with the frequency of sampling, assigning to various values from 0.1 to 10000Hz.  The behavior is the same until I approach the high rates where available samples remains to 2048-4096 sometimes, the display becomes continuous.

    Ahhh, Darn.  Yet another search was this link that points to the root of my confusion.  The 9237 can taste arbitrary rates using its internal clock.  Duoh!  I wish that the pilots are smart enough to warn you if there is a discrepancy between the selected sampling rate and capabilities of the device

  • 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

  • Continuous monitoring of the mouse (USB) with fixed sampling rate (500 Hz)

    Hello

    I'm quiet new to LabView and there are simple applications that I am still unconfortable with. I have to constantly monitors some analog channels to my DAQ and simultaneously to the value of X and Y of the mouse (USB). Signal acquisition of surveillance data are a simple procedure, but how to capture X and Y of the mouse as contibuous undulations sampled 500Hs (for example) so I can merge them to signal data acquisition? What is the synchronyzation of the signals of the acquisition of data and the extra-DAQ chanels created with data from the mouse?

    Thanks a lot for your help and your patience!

    Olivier

    Quick explanation:

    When I said "throw a timed loop around this" what I really wanted to throw a loop timed around "acquire input data.  I don't know how it applies to these screws (it certainly when you talk about material!), but generally when talking to a device we open/close only once and loop on the functions of acquisition/generate.

    -memoryleak

  • Reading USB-6008/DAQmx sampling

    I use LabVIEW Student Edition 2009 with an acquisition of data USB-6008 on a Windows 7 computer.  I must confess that I am rather self-taught in LabVIEW and may lack in fundamentals.

    I wrote a code to move motor back with a sine wave with the 'Signal to simulate"VI and VI"DAQmx Write. "  I think that this part of the code is OK but its probably sloppy.

    The part that that concerns me is the "DAQmx Read" part - I use this to get a feedback of the motor position on an analog scale 0 - 5V via the port of AI1.  I also use this DAQmx Read to get another feedback voltage from a force sensor that feels the force in a piece of material set by the engine.  I want the information to all-terrain such as graphs or tables with the last 30 seconds, and then a value of information, but that's all I want to see since this cycle repeats for hours.  I also need to process this information - if the strength of the material gets high, I need to stretch less etc.  So far, everything is working fine, but now I want to use the "peak detector" VI for expressly that the "peak" of the sine wave is part of a certain range of strength and the '' Valley '' falls into a second range of force and clearly since I read this information as a single integer/sample there is no 'memory' of the last seconds in the form of a table of examples past or a waveform or something like that I can't detect the peaks.

    So my question is - should be sampling this information differently to temporarily store information (such as a waveform or something?) or should I use individual samples to build a continuous array for the last 30 seconds?  In other words, what is the best way to read this information in a way that will make it easy to detect the peaks on the final seconds, but not to store hours of endlessly repeated information?  I also want the release of LabVIEW and feedback from the system graphics to match so that the signal sent to the engine for the same positional signal back to LabVIEW from the engine.  I should add that I do not know if the system works in real time or on a little late, but nothing like over delay of 30 seconds.

    I have attached a code that I use to calibrate my system - is not the same as I mentioned earlier, but things 'DAQ read' are the same and you get the idea with the rest of it.  I can also reach more detailed code if it would help.

    Yet once again, I'm sorry for my skills of coding bush-league and thanks for any help!

    -Chris

    If you always use a waveform chart to display your data and your happy with length of time of the chart, you can use the 'Historical data' property node for recover your data from 'short term' gathered.  From there, you take the data and make a type of waveform data using the 'build' primitive waveform.

  • Reading loop DAQmx only reaches the speed of Communication series

    Hello everyone,

    This is my first post in this Forum. I have a program with 4 loops, 2 separate and 2 connected by a queue. The first loop (see attachment loop PID) runs at maximum speed, the second a (serial communication) works at maximum speed (very slow because of the speed of series).

    To find the error I deleted from the queue to get 4 separate loops. The loop with the calculations (calculate loop) now also runs at the maximum speed, but the analog read loop just past the loop of serial communication speed. On the inside of the Sub - VI is just the configuration for the DAQmx with internal sampling. I have no connection between the loop of serial communication and analog playback loop. Is it possible that the DAQmx is slowed down because of the serial communication? Serial communication also uses a windows DLL.

    I hope you can help me.

    Best regards

    Jannik

    Thank you for your quick response. I found the answer, I guess that: I deleted the Subvi and the use of the DAQmx in the loop directly, it has worked. I think that the Subvi took too long because of the additional options to run at 1 kHz.

  • Generate data with 6722 and reading back with 6221 - it visualization with a virtual oscilloscope

    Hello

    I generate an analog signal with the 6722 and want to read with the 6221. The results shall be included in the virtual oscilloscope. My problem is that I don't know where to put the signal-chart and that I really need to use type. The second problem is that I have no idea how do I choose a time scale and where and how to define. Finally, I have that image that I get on the real oscilloscope with data generated by 6722 on the virtual oscilloscope with the 6221. Initially, the oscilloscope should have no (mode of operation only) trigger as the 6221 has only a digital triggering.

    For the moment, I have a loop that generates the signal using a sequence. Now, the question is where to put the signal-chart and what settings should I use for reading back information (1 sample, continuous, etc.).

    Thank you

    Verena

    Hi db2nc,

    Here is a link for an example of our community. It shows you an example with which you can generate a signal on output and gain on a different entry.

    I think that's what you want to archieve.

    Loopback synchronized analog output of analog input

    concerning

    Michael

  • several loops with error handling and controll

    I have a project where I spin 4 loops at the same time and must stop all the loops with a stop button as well as all the loops if one of the loops will receive an error.

    Loop 1.

    Loop start

    control the other 3 loops

    Loop 2.

    Analog voltage reading

    Loop 3.

    Digital inputs to read

    Loop 4.

    Write digital output

    Someone knows how to do this?

    Two other methods not mentioned in the otherwise excellent document that mentioned Matt are the use of a global variable 'stop all' and a relative using a Global Variable of VIG/functional.  The reason to talk about, is that they can be used also stop 'detached' live, live which are defined to run asynchronously (and therefore a bit 'out of control') regarding the main VI.

    I use a "combination of ingredients" for some projects I'm developing using LabVIEW 2016 and its support of the channels.  For example, I use a Messenger channel to create something akin to a message in queue manager.  When the event loop detects that the exit button has been pushed back, it puts a Message "Exit" on the channel of Messenger and stops himself.  When the Message Loop sees "Exit", it sends one release Message who else has need to see (in one case, the producer of a producer/consumer model) and stops himself.  When the producer Gets the output Message, it puts a "last element is invalid" on the flow of the channel for consumers and stops himself.  When the consumer gets the message of the last element, he stops himself.  A magnificent waterfall.

    And I work (not yet 100% complete) how to extend this to start the asynchronous calls that do not (yet) support channels as easily...

    Bob Schor

  • Reading data with NOR-5772

    I'm reading the data with the NOR-5772.  I tried the example code(NI_5772-Getting_Started_(Host).vi), and it will read noise (with nothing plugged into channels).   However when I try to send a signal (such as that generated with a NEITHER-DAQ card on the same system and routed to AI0/AI1), the signal does not change a lot of the noise.   I have the drivers updated and am under LabView 2012 (32-bit and 64-bit, I get the same result)

    Everyone has to experience this problem?   Thank you.

    Yes, the device is AC coupled and has a high pass filter.  There is a diagram of frequency response on page 20 of the user manual:

    http://www.NI.com/PDF/manuals/373625a.PDF

    It seems that the cuttoff frequency is about 100 kHz.

  • How to exit while loop with delay schedule?

    I have a pretty heavy program that iteratively takes a series of measures from a number of channels using a variety OR-Switch and OR-DMM screws that I assembled as a result of various examples and several help pages. Each channel is sampled once during each iteration with data to be saved in a text file for later analysis, after it is imported into Excel. I added to the screen 'real time' indicators and charts to see what looks like running data.

    Each iteration is performed using a While loop with a delay timer, even if a previous version, I used a timed loop. Measures for the series of channels are collected with a loop For inside the While loop. The loop For includes screws which:

    1 cut the channel and wait as debounce.

    2 Initializes the DMM and passes the configuration information.

    3. wait for a while to make sure that the DMM is set.

    4. measure.

    5. close the DMM.

    6 disconnect all the switches.

    The terms of the election of the channels is ends in 15-20 seconds and I am currently collecting data every two minutes, so he spends "wait" time "collection". Each iteration of the loop For initializes and closes the DMM to avoid the hot switch.

    Other components of the program are configuration setting controls, etc. (in front of the While loop), a "current measurement" indicator and a writing-text inside the loop file operation For, several indicators of the iteration (inside the While loop, but outside the loop For) and a bunch of operations related to the grouping and table that provide graphics of groups of time vs measures.

    I don't know there are more elegant ways to perform many functions that I do and I'm not posting the VI here because I want to concentrate on what I know, it's a big problem with my program (for now!) - I can't figure out how to get out of the While loop. I tried the combinations of Boolean control, its conditions of latch and Stop / continuous if true to nothing does not.

    I want a 'Stop' button that ends the While loop, at the next opportunity, but it is not working properly, I think, because the stop button does not play with good timing, because the program runs either the loop For or the time delay at the beginning of the While loop. 'Next opportunity' can mean 'Immediately', 'at the end of the next iteration of the loop,"or"at the end of the next delay schedule." I think that if I get one of these scenarios to work, I can get an any of them to work!

    Help, please!


  • Need to view daq reads per second but only to record a reading every 10 minutes. I would also like to record the date and time, at the same pace. Need help

    Need to show daq reads per second, but only to record a reading every 10 minutes, need help

    You are also looking to taste to 1 Hz data acquisition?

    My approach would be to use the DAQ acquisition to time your loop display reading each acquisition, then use the loop counter to control the logic of your writing to file.  For 1 Hz and 10 minutes write I would use 'quotient and remainder' I / 600; If rest = 0, then write the data point.

    For the date and time, under Calendar palette use the time get in seconds food a DateTime Format to a string.

  • acquisition of data with different sampling rates high

    I have a few questions on the use of the OMB-DAQ-3005 with different sampling rates high.

    For our application, we have 8 analog inputs. Which two are a quick response and should be sampled frequently.  We have an encoder quadrature (CPR 1000 running at 1800 rpm).  We plan to sample X 4 encoder.  For the analog inputs for the quick response, we want to trigger a sample of each pulse or each a few pulses, thus creating a timestamp with the position of the encoder with respect to position index as well as two fast analog inputs.  We have data correlating the analog inputs with the position of the encoder.   Other analog inputs, we want to measure relatively slowly (for example once every 5 dry or similar).

    How can I go on the configuration of the two (or more) sampling rates different wherein I can taste entered at different frequencies?  Also, is there a way to reset the encoder count after outbreak of the index as I have the position of the encoder with respect to the index?

    Maybe you'll find someone here who uses the OMB-DAQ-3005, but this forum is really more designed for LabVIEW programming issues.

    I've never used the OMB-DAQ-3005, but out of curiosity, I took a glance at the Manual of OMB-DAQ-3005.  The answer to both your questions are:

    1. you cannot run a hardware DQA Multiplex (like this one) at independent rates by channel.

    2. the OMB-DAQ-3005 supports an Index Z feature to reset the counter - look for documentation on how to configure any software interface you are using.  If you get stuck, you can try to discover media appropriate for instrument channel.

    Best regards

  • play sounds temporary and file of your choice when reading data with VISA functions?

    Hello.

    I read the function of reading data with VISA and then I use as multiple functions to display data on the graph. everything is OK.

    now, I want to play a sound specified (like a song in my desired folder 3s) signal which cross above the specified value range. then after the desired time, it will wait still new cross above the specified value and this repetition of the procedure until I stop the program.

    Data MCU is from and it does not stop when his game system and what system of incoming data for this part (his play) will ignore them pending that outdated.

    I use this for reading data and part VI mentioned which belongs to her is empty and I don't know what I have to do?

    altougth I use an another while loop for his apartment because I want to save time CPU.

    Thank you.

    I recommend you do the data type of the notifier a cluster that contains a path and a numeric (double).  The path indicates the reader what file to play.  Digital is the duration.

    Now in a way a bit complicated, but really good stop your second loop.  Do not use a second notification.  Instead, send the normal notification but not use a path for the path in the cluster.  Your second loop can write a check for the path of a not and stops when that is received.

  • Need an example of loop with sql statement in shell script values

    Hello

    I have to present a simultaneous program to each line of the table through script shell (only).

    The table has all the parameters required to pass to the concurrent program.

    I have trouble in a loop with the lines of sql statement results.

    Could someone give me an example of a shell script with a loop with the sql statement values.

    appreciate your time and your help.

    Thank you

    Ganesh

    Hello

    Here is a guide using 3 parameters:

    {

    sqlplus-s $OA_USR / $OA_PWD<>

    SET THE OFF POSITION;

    SET FEEDBACK OFF;

    SET LINESIZE 300;

    SELECT param1, param2, param3

    Of your_param_table;

    ENDOFSQL

    } | while reading line

    do

    If ['$line'] # line non-NULL

    then

    set $line

    param1 = "$1."

    param2 = "$2."

    param3 = "$3."

    # Pass parameters to a script, sql more

    sqlplus-s $apps_usr / $apps_pwd @SUBMIT_CONC_PROG.sql $param1 $param2 $param3

    FI

    fact

    }

    In your SQL * more script you run 3 parameters into variables:

    declare

    VARCHAR2 (10) param1: = ' & &1';

    VARCHAR2 (10) param2: = ' & &2';

    param3 varchar2 (10): = ' & &3';

    .....

  • The font is to small for me to read even with my glasses on

    I find that the police is to small to read even with my glasses. I tried the advanced settings, fonts and colors, you suggested, I have not worked for me. I want to know how to solve the problem where I can read the fonts in a comfortable way without forcing my eyes. I installed the Mozilla Web browser on an older version of xp laptop. Thank you.

    You can set the layout.css.devPixelsPerPx pref on the topic: config page on 1.0 or Windows 8 to 1.25 and if necessary adjust layout.css.devPixelsPerPx from 1.0 to 0.1 or 0.05 steps (1.1 or 0.9) do the icons to display properly.

    See also:

    An extension allows you to adjust the size of the text in the user interface and zoom the page in the browser window.

    You can watch this extension to adjust the font size for the user interface.

    You can watch the Default FullZoom Level or NoScript extension if the web pages need to be adjusted after the change of layout.css.devPixelsPerPx.

Maybe you are looking for