Error -200279 at DAQmx read

Hi i am fairly new to daq in labview,
i have code which accepts data from 2 devices a PCI 4351 connected to a TBX 68T and PC1 6111S card connected to a SCB68 block. i have uploaded the code.
when the code is running and then when i press the stop button on the front panel, i get an error of -200279 which is something to do with the daqmx read. I have looked into some other problems that some have faced on this error in this forum, and hence i have tried to increase the rate whilst keeping the number of samples the same but this has done nothing and the same error appears.
any suggestions will be greatful!
thanks
Notay
Attachments:
Copy of NI 435x Thermocouple (LEE).vi ‏124 KB

Well the main problem is you have two different mechanisms to control the speed of your while-loop. First in the upper right hand side of the loop there's a wait until next (100) ms. The second timing method is the read 5 samples in a 1000 Hz stream, this only allows for 20 ms wait time.
AFter a while your buffer will be full (by the way you don't need to specify the number of samples per channel) and the AI read will generate an error.
Make sure you end the while loop as soon as the error is generated you don't check inside the while loop which is  a bad thing.
To avoid this you have to decide how to time your while loop.
I would set the number of channels to read to -1 (be aware you get 100 samples from the AI read)
Also replace the 'wait until next ms' with a 'wait ms'
And check for errors inside the whil e loop
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!

Similar Messages

  • Error 200278 and error 200279 with DAQmx read

    Good day everyone,
    I have been trying to write a code which generates a sine wave and a trigger signal and send them out to two different devices. I am trying to phase lock device-1 on a certain phase angle of the operating signal  (sine wave) of the device-2.
    The device-1 which receives the trigger signal also generates a trigger signal at the same time it receives the trigger. It also can not work with trigger signal with a frequency which is greater than 4 Hz.
    I got that part to work and then I realized that I need to make sure that the responses of the devices have the same phase difference. So I added another part to the code which reads the trigger signal generated from the device-1 and the sine wave generated by the code (which basically goes to the device-2).
    I did not have any loop in the code at the beginning, and I just set the sampling frequency and sample rate and I though that it would work at the rate which I want. Unfortunately it did not. So I added a while loop to control the speed of the writing and reading process, and slow it down to 4Hz which is the limit of device-1.
    I have tried the reading process with finite sample and continuous sample on the sample clock and I got Error 200278 and Error 200279 correspondingly. Attached please see the main VI and subVIs. There are some subVis for writing data to the file which are not attached.
    I really appreciate it if you can help me to solve this problem and get the code to work in a way that the whole process works at 4 Hz frequency.
    I am not sure if my code is completely optimized. Any suggestion to optimize the speed of the code and the way it acquires data is also highly appreciated.
    Regards,
    Pooya
    Attachments:
    Trigger_Seq_R1.vi ‏115 KB
    time.vi ‏23 KB
    wavegen.vi ‏33 KB

    Hello Pooya,
    You need to add some wait delay in your while loop. Try adding a Wait Until Next Millisecond Multiple to your while loop with a constant wired in.
    You are acquiring data too quickly. Here is a link that discusses this in general.
    Regards,
    Jeff L.
    Applications Engineer | National Instruments

  • Error -200279 in DAQmx

    Hi all,
     I am using NI PCI-6251 on Labwindows. Basically i am acquiring two analog signals one of freq 200 Hz
    and the other of freq 1 KHz using "ContAcqIntClk" example that is shipped with CVI.
    The problem is that on the default settings that are
    Samples per Chan  = 1000
    Sampling Rate = 10000
    The program works fine but when i changed the sampling rate that is
    Samp per chan = 1000
    Sampling Rate = 20000
    After running for approximately 25 seconds. The DAQmx gives the Error (-200279)
    "DAQmxErrorSamplesNoLongerAvailable" . Why is this so?
     It is mentioned in the specs of 6251 that it is capable of sampling at the rate of 1 MS/s,
    so why it is giving error for only  20 Ksamples per second per chan.
     I want to add one thing more that I am also writing the samples of the acquired signals
    to the separate text files in the same while loop in which i am using DAQmxReadAnalogF64. 
    Any help will be greatly Appreciated.

    Hello,
    This could be due to a buffer overflow.  The following Knowledge Base articles should be able to walk you through how to avoid this.
    3WAC2E3Q: "Overwrite Unread Samples" Overwrite Mode causes Buffer Overflow Error -200279
    http://digital.ni.com/public.nsf/allkb/64243F5D9995450B8625714F007C81F6?OpenDocument
    2XQEAPQJ: Common NI-DAQmx Error Codes and Solutions
    http://digital.ni.com/public.nsf/allkb/001DA4DB6A31CF8886256D33006FA857?OpenDocument
    Hope this helps!

  • Error -200279 of DAQmx

    Hi all,
    Attached are two VIs for generate and measure signal with DAQmx. An error -200279 occurred when I measure harmonic distortion. There is no error if I turn it off. What's wrong of the program? I'm using LabVIEW7.1 and PXI-4461.
    Bill
    Attachments:
    error_200279.zip ‏112 KB

    Hi Bill.
    I reproduced the problem in my PC. I think the problem was in your vi (some extrange incompatibility between HarmAnalyzer and Daqmx read). I erased the while loop and redid again and now It runs OK. Your PC can deal with theese vis in real time, as mine, using generator too.
    See attached vi. I used LV7.0/nidaq7.2/PCI6052.
    Hope it helps
    Alipio
    "Qod natura non dat, Salmantica non praestat"
    Attachments:
    test.vi ‏99 KB

  • DAQmx error 200279

    Here's a link to a thread on the Measurement Studio discussion board dealing with DAQmx error 200279 (trying to read data buffer that has been overwritten while running continuous aquisition):  
    http://forums.ni.com/ni/board/message?board.id=232&message.id=2926&query.id=12659#M2926
    These errors can be dealt with by modifying the RelativeTo and Offset properties of DAQmx Read. The same thing applies when using DAQmx in LabVIEW, so I thought this may be useful here.
    Zador

    Update:
    Changing the priority under VI properties to a higher or time sensitive setting has helped decrease the build up of samples in the task and increase performance of the loop, but it seems that there are more issues possibly related to the number of visible items on a VI front panel.  I have a number of objects that toggle their visibility based on which item is selected in a menu, and when objects with graphs are displayed, I notice performance dropping and samples accumulating.  No solution yet.

  • Error -200429 DAQmx read (counter u32 1ch 1samp).vi -append- Edge count in for loop

    I am receiving error -200429 DAQmx read (counter u32 1ch 1 samp).vi <append>. This is occuring on the second loop of a for loop.
    I have a sequence inside the for loop that is using four DAQmx assistant vi's for edge count at various times in the sequence. All four of these count fine the first time through but at the beginning of the second loop the first edge count receives this error and does not count.
    Any ideas?

    The code you have supplied is similar to the converted subvi but this code will give an empty task error on the DAQmx Create Channel vi.
    Notice on the Daqmx create task vi that there is nothing wired to the "Task to copy" or the "Global virtual channels" connectors - I believe this is why the task is empty when sent to the Daqmx create channel vi.
    The code we are currently using is a modification of a previous code used before a recent upgrade. It may be better in your/NI eyes to re-write this into a State machine but time constraints and resources do not allow that at this time - All other parts of the current program work except for the counter on the second iteration. Would rather not reinvent the wheel at this point. 
    If the task is being cleared was the issue then the other three should also not execute. The issue appears to be the "First Call"
    I have attached a zip file of the complete program as it is now written to give you a better idea of the whole picture.
    Attachments:
    Test Machine current code.zip ‏657 KB

  • Error code -200088, accessing DAQmx read function in fncB from fnc A

    Hi,
    I am using NIDAQ 6229, and C code.
    My c code is as follows:
    #define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }
    int main()
      TaskHandle aiTaskHandle;
    // and the variables whatever used in the API's declaration below done here and initialised
      DAQmxStartTask (aiTaskHandle);
      DAQmxErrChk (DAQmxCreateTask("AI Task",&aiTaskHandle));
      DAQmxErrChk (DAQmxCreateAIVoltageChan(aiTaskHandle,AIChannelList,AINameList,DAQmx_Val_RSE,0.0,10.0,DAQmx_Val_Volts,NULL)); 
      DAQmxCfgSampClkTiming(aiTaskHandle,"OnboardClock",AIRate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,AISamplesPerChannelAcq);
      while(1)
                fncB( );
    fncB(  )
                DAQmxErrChk (DAQmxReadAnalogF64  
                  (AITaskHandle,DAQmx_Val_Auto,timeOut,DAQmx_Val_GroupByScanNumber,AIReadArray,AIarraySizeInSamps,&AISampsPerChanRead,NULL));
    This Code builds without errors and runs. But the problem is with calling the fncB( ) where the DAQmx read for aiTaskHandle is executing.
    The DAQ read works fine for one time, but in the second call of fncB it gives error " task specified is invalid or does not exist" with error return code: -200088.
    why for the second call , the task specified becoming unknown is not yet all clear.
    the ni error codes document doesnot list this error code yet all.
    i have tried in declaring aiTaskHandle variable global, then in the first time of calling fncB it gives the error as mentioned above.In my application i cant use DAQRead in the same function where i declared the taskHandle , so i have to call it from the function.
    Does some body help in calling the DAQread from another function, and why this task is becoming invalid for the second call,.
    Thanks ,
    vishnu
    Message Edited by gkvishnu on 10-12-2005 08:10 AM

    I found where does my error come from.
    I configure my task from a other function and call this callback to start acquisition (get partly from NI examples)
    I get the error on the Start_AI_Clk(taskAIClk); call.
    int CVICALLBACK AI_TrigStartCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
        int32       error=0;
         char        Chaine[500],Chaine1[500],ChaineFormateur[500];
        int32       numRead;
        float64     *data=NULL,*dataMoy=NULL;
        int         i,j,Checked;
        double        LocValeurLue,TempsDebut,TempsTotal,TempsEnCours;
        long int     NbMesTotale = 0;
        FILE         *TempFile;
        if( event==EVENT_COMMIT ) {
            if( (data=malloc(NbMes*NbChanAIClk*sizeof(float64)))==NULL ) {
                MessagePopup("Error","Not enough memory");
                goto Error;
            TempsDebut = Timer();
            TempsTotal = TempsDebut;
            TempFile = fopen("TempoResult.txt","w");    
            Start_AI_Clk(taskAIClk);
            ProcessDrawEvents();
            gRunningTrig = 1;
            while( gRunningTrig )
                DAQmxErrChk
    (Read_AI_Clk(taskAIClk,NbMes,data,NbMes*NbChanAIClk,&numRead));
                ProcessSystemEvents();
                 /*data treatment*/
            TempsTotal = Timer() - TempsTotal;
            fprintf(TempFile,"Temps total:%.3f - Nb Mes totales : %d",TempsTotal,NbMesTotale);
            fclose(TempFile);
    Error:
        if( DAQmxFailed(error) )
            TraitErreurCarteDAQmx("Lecture AI horloge externe",error);
        if( taskAIClk!=0 ) {
            Stop_AI_Clk(taskAIClk);
        if( data )
            free(data);
        return 0;
    What happen is when I click on my start button, my function is executed
    once before a EVENT_COMMIT came, so it jumps directly to the Error part,
    then as the taskHandle is not null, it stop the task
     if( taskAIClk!=0 ) {
            Stop_AI_Clk(taskAIClk);
    Then it executes the if(event==EVENT_COMMIT) part and as the task has been stopped, it give the -200088 error code.
    To correct this, I change the Error treatment like this:
    if( DAQmxFailed(error) )
        TraitErreurCarteDAQmx("Lecture AI horloge externe",error);
        Stop_AI_Clk(taskAIClk);
    Yop!
    DanY

  • Error -200279 DAQmx

    Hi,
    I am reading 3 channels of data into a waveform chart at a speed of 512 Hz, and my waveform chart seems to slow down over time and eventualy stops working, then i get the error -200279?
    ReadSamples.vi<append>
    <B>Property: </B>RelativeTo
    <B>Corresponding Value: </B>Current Read Position
    <B>Property: </B>Offset
    <B>Corresponding Value: </B>0
    <B>Task Name: </B>AnalogInput
    I use a master/slave message handler structure and in my master is the "read samples" vi which reads 4 samples at a time, when i display 1 channel it works okay, but the more channels i display the slower it gets...?  
    Best regards,
    Thijs
    Solved!
    Go to Solution.

    It looks like you are getting a buffer overflow... You aren't reading data into your application fast enough. 
    http://digital.ni.com/public.nsf/allkb/AB7D4CA85967804586257380006F0E62
    Ian K.
    Applications Engineer
    National Instruments

  • Error-200279 when reading Analog Wfm Nsample

    I'm calling the attached VI at least 10x in the main VI and works fine but sometimes it's giving me an error-200279. Can someone please tell me why?
    Thank you in advance.
    KowdTek
    LabVIEW 2009
    One Step At A Time, Maybe Two...
    Solved!
    Go to Solution.
    Attachments:
    Detect Frequency.vi ‏25 KB

    Your buffer isn't big enough.
    You are collecting 20,000 samples per second, but only set it for 2000 samples per channel.  So that is 1/10 second worth of data.  You are reading 1000 samples at a time, so about 1/20th second.  If the loop is running fast enough, you can keep up and won't get an error.
    If there is a small delay (perhaps Windows goes off and does something else for 50 or 100 msec.) your buffer will overflow.
    I'd suggest eliminating the 2000 constant where you set the samples/channel and try again.  See if it behaves better.

  • Producer consumer error 200279

    Hello,
    So I’m about to go crazy and hoping someone can help me here. I’m writing a program that controls a motor and using a producer/consumer method to write the data at 10,000 intervals a second. I’ve read through multiple examples and I don’t see what I’m missing. I’m trying to record 18 different readings from a DAQ 9178, 3 readings for voltage module NI 9205, 1 reading for current module Ni 9203, 2 readings for accelerometer module Ni 9234 and 12 readings for temperature module 9213. Every time I run the program I keep getting the error message 200279 and it states that it’s trying to read samples that no longer exist. It advised me to increase the buffer rate. So I did as it suggested in multiple ways and the error messages keeps showing up. I’ve also shut down the computer, exited and restarted Labview several times and none of this worked. I have included the a picture file below.  Where the problem is, is in the producer loop and the error is shown coming out of the DAQ error indicator. One idea I had but I’m unsure how to approach it is to somehow mean the data coming out of the DAQ to reduce what’s getting to the buffer. If anyone knows how to fix this problem please explain it in detail (I mean talk to me like I’m stupid) cause I’ve been stuck on this problem for almost two weeks now. Thank you in advance to anyone who can help.
    SteelTiki  
    Solved!
    Go to Solution.

    The DAQ error isn't related to your choice of architecture, although your implementation of it might be hurting you.  It's almost impossible to follow what's going on in your diagram because you have wires running in many directions (try to keep data flowing from left to right), there are local variables all over the place (almost definitely not needed), and there's a lot of code that's not in the image or is hidden in another frame of the sequence.  Normally one would not have the event structure as the consumer loop (as you've done), and it's generally not a good idea to have multiple event structure in the same VI (with rare exceptions usually involving user events).  It might not solve your problem but it would be worth taking the time to clean up your diagram.  Eliminate sequence structures and local variables as much as possible, move some code into subVIs, and straighten out your wires.
    As for the DAQ error: the DAQ board is reading data into a circular buffer, and you're not reading it fast enough, so samples are being overwritten.  The reason you're not reading it fast enough is because you only read a single sample at a time (the DAQmx Read is configured for 1 sample on multiple channels) but you say you're acquiring 10,000 samples/second.  Since your loop won't run 10,000 times per second, you're not reading all the data, which causes the error.  Try configuring the DAQmx Read for multiple samples.

  • Error 200279 Continuous DAQ Assistant

    I am getting Error 200279 while running my VI.  I am using a DAQ assistant with four channels set to Continuous Samples with a rate of 1K and Samples to Read at 100.  The error comes up at different times.  It can happen right after starting the vi or it has happened as late as 2 1/2 hours of running the vi.  I added the DAQmx property node to observe the number of available samples per channel.  The number of available samples is stays at 0 but then will spike in a few seconds until it goes over 10,000 available samples and the error pops up.
    I'm at a loss as to what might be causing the sudden spike of samples because the program does the same calculations each iteration of the loops.  Therefore, I don't believe the program is running to slow to read the samples.
    Thanks for the help,
    Tony

    I am writing to a file called datalog.csv.  At first I thought it might have been the cause.  When I got the vi, the data is recorded to datalog.csv at a period determined by an input, Sample Rate.  The fastest I have written to the file was 20 ms (50 times a second) which meant the program was opening, writing to, and closing datalog.csv 50 times a second.  So I did change how the data was saved by moving data writing to a separate loop and by only opening the closing the file once. but I still got the error, so I changed the program back to the way it was.
    a little bit of input on the vi.  it is for controlling a tesile strength tester.  it controls the amount of tension is being pulled on a powerline cable.  the controller in the vi is the bottom loop.  writing to datalog and the data acquisition are located in the top loop.
    Thanks
    Attachments:
    cabletest_v2_input_test.vi ‏747 KB

  • Error -200279

    Hi friends,
    I am getting the error -200279 during acquisition.
    I have developed the application in a PXI located at my place.
    The application is running fine in that PXI.
    But when I ran it on PXI which is located at a remote site. It is giving this error -200279.
    I have run the application using remote desktop connect at the remote site.
    I have run the application in another PXI located at my place. There also the application is running properly.
    Can anyone provide solution for this issue.
    Thanks in advance...
    Into the pursuit...
    Maverick

    Hi Maverick,
    what exactly are you doing in your application?
    The error message tells me that you do data acquisition and you are not reading data from the PC Buffer fast enough.
    There are several methods to avoid that problem:
    −Increase the buffer size with the DAQmx Timing VI
    −Increase the Number of Samples per Channel to read with DAQmx Read VI
    −Decrease the Samples per Channel per Second acquisition rate with the DAQmx Timing VI
    −Don’t do any extra processing in your loop with the DAQmx Read VI
    Stefan

  • Stuck in Error -200279

    My program involves several DAQ tasks that run in lockstep, after the fashion of the "Multi-Function-Synch AI-AO" example. Works very well in general, but if anything ever interrupts the flow of the program, I get permanently stuck with error -200279. Here is the precise report:
    Error -200279 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi:1
    Possible reason(s):
    Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
    Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.
    Property: RelativeTo
    Requested Value: Current Read Position
    Property: Offset
    Requested Value: 0
    Task Name: Analog input
    And once I am in this state, the only way I can find to get out of it is to kill and restart all my tasks. Surely there is a better way? How do I resynchronize so that the computer quits asking for old samples and gladly accepts the ones that are there NOW?
    Here are a couple of reliable ways to bring on this problem: 1. Hit a breakpoint while debugging. This is very exasperating, when you can't use a breakpoint without destroying the very operation you're trying to debug. 2. The user presses a button that opens a file dialog. Even though my main program consists of several parallel loops, and the file dialog is called from a DIFFERENT LOOP from the one that is doing the data acquisition. That's a problem anyway. How can I bring up a file dialog without stopping my DAQ flow in midstream?
    Help eagerly appreciated. This problem is stopping my program from being the industrial-strength job that my scientist users need.
    Thanks,
    Ken
    Solved!
    Go to Solution.

    Hi Dan,
    Agree with you in general.  In our specific case, we need to recognize the error but then immediately move on and get the next available data.  What I think I understand from earlier in the thread is you need to manually move the RelativeTo and Offset to the most recent data and then continue.  Here's what I have tried, and it seems to work.  This is placed in the error handing code (essentialy in the DAQmxErrChk, so you have to worry about recursion because of calls to DAQmxErrChk).
         Case -200279
             ' Force DAQmx to read the most recent sample in the buffer
             DAQmxErrChk (DAQmxSetReadOffset(ByVal AITaskHandle, -1&)) 
             DAQmxErrChk (DAQmxSetReadRelativeTo(ByVal AITaskHandle, DAQmx_Val_MostRecentSamp)) 
             ' now read just one value to resynch everything
             DAQmxErrChk (DAQmxReadAnalogF64(AITaskHandle, -1, 1#, DAQmx_Val_GroupByChannel, AIData(0), 1&, sampsperchanread, ByVal 0&))
             ' now reset DAQmx to read from the current position from now on
             DAQmxErrChk (DAQmxSetReadOffset(ByVal AITaskHandle, 0&))
             DAQmxErrChk (DAQmxSetReadRelativeTo(ByVal AITaskHandle, DAQmx_Val_CurrReadPos))
    The only problem is I don't really know if this is working as expected!  Not sure how to really tell.
    Van

  • Error 200279 and number / frequency of logged data

    Hello,
    I am new to LabVIEW and I am writing a VI that sends 2 voltage (AO voltage) to a motor, and read the voltage input (AI voltage) from a strain gauge and one of the corresponding AO signal that I sent out to the motor. Also, the VI reads encoder value. I am using a PCI 6230.
    I am unsure of the difference between the number of samples per channel in DAQmx Read (AI Volt), DAQmx Read (Encoder), and DAQmx Write (AO volt).
    If I set all three values to 1 (like in the attached VI), I will get a log data that has logical data for DAQmx Write (AO volt) and DAQmx Read (Encoder) (values changing and logged every 1ms). However, the log data from DAQmx Read (AO volt) has some error (it's not logging data with increment of 1ms), then the Error 200279 shows up.
    If I set DAQmx Read (AO volt) to 1000, and the other two to 1, I will get DAQmx Read (AO volt) data with increment of 1ms, and the others increment of 1s. While if I set all to 1000, my encoder and DAQmx write data will lag (shows up late in the log) by 1s (transient data is not shown, only stedy state after 1s).
    I have been trying to troubleshoot and read about the error description but found no helpful clues.
    Appreciate your help.
    Thanks a lot!
    Attachments:
    AnalogOutputandInputRev1b.vi ‏135 KB

    Hi Thomas,
    Thanks for your inputs. I have tried using the "Shared Sample Clock" example but I have an error which says:
    Error -200077 occurred at Property Node DAQmx Timing (arg 1) in DAQmx Timing (Sample Clock).vi:6->AnalogOutputandInputRev1c.vi
    Possible reason(s):
    Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
    Property: SampTimingType
    Requested Value: Sample Clock
    You Can Select: On Demand
    Task Name: _unnamedTask<2DE>
    And then,
    Error -50103 occurred at DAQmx Start Task.vi:3
    Possible reason(s):
    NI Platform Services: The specified resource is reserved. The operation could not be completed as specified.
    Task Name: _unnamedTask<2DF>
    I have attached my modified VI here as well.
    I would like all my tasks to occur at the same time, and most importantly, logged at the time it happens without some delay.
    Would you please advise on what's going wrong with my VI this time?
    Thank you very much.
    Attachments:
    AnalogOutputandInputRev1c.vi ‏131 KB

  • Error 200279 in SignalExpress

    Hi,
    I'm using a full-Version of SignalExpress 2.0 with a cDAQ-9172 with NI9205-Module and NI-DAQmx 8.5. SE is configured for continous sampling two voltages with 1k-Samples per read and 10kHz Sample rate. In the recording options, I defined a leaving-window-Trigger to start logging with a 5s pretrigger and an entering window to stop it again (5s posttrigger).
     The problem is, that the logging crashes with error 200279 shortly after trigger-event. I've searched the web, but only found solutions for Labview. Turning off "Prepare log data for viewing" did not help. There is nothing but SignalExpress running on the computer.
    Has anybody a tip? 
    Thanks in Advance.

    Hi,
    please read this KB in order to track down why your DAQ is overflowing.
    http://digital.ni.com/public.nsf/allkb/7AD4854943BF344186256D6500807935?OpenDocument
    M. Brauner NIG

Maybe you are looking for