Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 200284 from DAQmx Read using USB6259

This error of 200284 has been persistantly showing up in my high speed data acqusition using DAQmx Read with USB6259 running LV8.5.1 and DAQmx 8.7.1.  I tried most of the approaches discussed on this forrum regarding this error such as increasing time out and sample rate, but still getting it. I stripped down the application that I recently took over and attached the basic vi..please voice any suggestions, thoughts, solutions, and comments, I really would like to see this code work out as it is our basic stuff.  many thanks in advance. 

 

A little more detail...the original code (and this striped down version) would run for a minute or so with the loop index getting to over 20k, or 40k..but most likely stop before 60k with unpredictable numbers...thanks again for taking a look at the vi.

 

Bryan 

0 Kudos
Message 1 of 10
(4,603 Views)

Hi Bryan,

 

I took a look at your code, and after modifying the analog output channel, I was able to run it fine for a very long time on a PCI-6251 board without any errors. One thing that I am interested in is the analog output task that you are referencing, since I am unable to see what type of setup you have configured for this channel. I am interested in knowing why the analog input task is using the ao/sampleclock as the source for its sample clock rather than the other way around (ao channel using the ai/sampleclock). Usually, when this type of -200284 error occurs, it is due to a problem with not receiving a trigger or sample clock edges. Perhaps something is happening to the analog output task that is affecting the analog input channel since it is using the ao/sampleclock.

 

A couple of other things I would like to know more about are why you are reading just a single sample each loop iteration and also what your application involves since I noticed the program samples numerous times on the first channel for each single sample on the others. What overall rate are you trying to accomplish as well? Please let me know if you have any additional insight into your application. Regards,

Daniel S.
National Instruments
0 Kudos
Message 2 of 10
(4,581 Views)

Hi Dansch,
Thank you for looking into this issue!  I have compiled a reply to your comments and questions in the following quoted message: 
dansch wrote:

Hi Bryan,

 

I took a look at your code, and after modifying the analog output channel, I was able to run it fine for a very long time on a PCI-6251 board without any errors.

--------------------------------------------------

Our original code also runs ok with our PCI boards, only after we switch to USB then we have this problem of error 200284 stopping the acquisition. The code also runs ok on one laptop with older USB (XP service pack 1), the two laptops with newer USB2.0 always have problems with error 200284 on one and 200279 on the other(XP Service Pack 3).  I am trying to get the one with 200284 to work.

  

One thing that I am interested in is the analog output task that you are referencing, since I am unable to see what type of setup you have configured for this channel. I am interested in knowing why the analog input task is using the ao/sampleclock as the source for its sample clock rather than the other way around (ao channel using the ai/sampleclock).

--------------------------------------------------

The was not clear about the logic of the triggering setup of the initialization step, however, the analog output task used the task input setup from MAX, this also triggers the timing on the analog input.  The output chain is for running a light source with a wave form generated by a separated VI using the waveform parameters as shown on the front panel of my attached SampleVI.  This source runs continuesouly with the same waveform  function.  The input chain reads a detector contineously as DAQmx Read was put into the while loop. The start of the output waveform was triggered by the input chain so that the light source and data acquisition are synchronized.   We never had problem to start the data acquisition as we always read the correct waveform back.  The error seem to alway came from the DAQmx Read function in the while loop as the code on the left side of the while loop onlys runs once, while the while loop will keeping running, until it stops a minute or so later by the error 200284.

 

Usually, when this type of -200284 error occurs, it is due to a problem with not receiving a trigger or sample clock edges. Perhaps something is happening to the analog output task that is affecting the analog input channel since it is using the ao/sampleclock.

 ------------------------------------------

I will check further on the output task setup in MAX..if this is the issue, what is the recommended setup for the output task? 

 

A couple of other things I would like to know more about are why you are reading just a single sample each loop iteration and also what your application involves since I noticed the program samples numerous times on the first channel for each single sample on the others. What overall rate are you trying to accomplish as well? Please let me know if you have any additional insight into your application. Regards,

-----------------------------------------

I was only reading a single sample for the demo purpose as it generates similar error as in the original application where we read all channels. The first channel is where the detector response are read and are accessed at the highest frequency.  That is why we build 992 instances for this channel and leave the other 8 channels to read some other environmental parameters which happens at a less frequent time. This allows us to keep data acquisition going without restart other tasks. This was recommended by an NI engineer earlier to another enginer here and was work fine. 

 

The following are some of our input parameters:

On the Outuput side:  Waveform Scan Rate or Frequency (Hz): 1000    Number of Points in Waveform is 1000,  Waveform Update Rate is: 1000000/s, this final rate goes to output timing VI 

On the Input side:      Number of Sample Spectrum (total numb. of channels) 1000.  Number slow channels: 8.   Input sample rate: 1000000(Hz). This rate/1000=1000/s goes to the input timing VI 

 

Please let me know if you need more info, if you do not mind, could you please send me a number and best time to call?  Many thanks.

Bryan 

 


 

0 Kudos
Message 3 of 10
(4,573 Views)

Hi Bryan,

 

I would recommend to make the following change to help us troubleshoot your code:

 

Since the timing of the AI Task is coming from the AO Sample clock, it could be possible that the error message you are receiving is actually a symptom of the main problem.  What I would suggest to do is actually wire parallel error threads inside your acquisition loop (one for the AI and one for the AO task).

  1. Use the IsTaskDone? function to get the status of your AO task inside the loop.
  2. Use the status of each of these wires (OR them together) along with your stop button to determine when the loop should stop.
  3. Merge the error wires after clearing your tasks and use the Simple Error Handler after you clear your tasks

As Daniel mentioned, the problem could very well be with your AO task.  When the AO task errors out, the sample clock would stop and your AI task would timeout as a result.  Handling your errors will provide much assistance in helping to troubleshoot the issue.  Thanks for posting and have a great day!

 

-John 

Message Edited by John P on 02-18-2009 05:03 PM
John Passiak
0 Kudos
Message 4 of 10
(4,550 Views)

Hi John,

 

Thank you so much for your help and support.  Sorry for getting back to you late as I was monitoring the other thread I posted on LabVIEW forrum which got a little more attention. I did what you suggested and checked on the AO IsTaskDone and got a "True" inside the loop before error  200284 showed up.  I believe you are right the AO error out first, but I still have trouble to fix out why it happend.  I added some debugging code to my previous SampleVI and included some subVIs, that seem not helping as the error was likely originated from the AO instead of AI.  Please see my attached new sample, hope to hear from you.  Thanks again.

 

Message Edited by BryanL on 02-19-2009 05:02 PM
Download All
0 Kudos
Message 5 of 10
(4,540 Views)

Hi Bryan,

 

I have attached your code slightly more cleaned up with some error handling (if an error is returned by either task, the loop will stop and the error will be shown). I was just wondering if you could try this and see if the output task is throwing an error and causing the loop to stop. The fact that you are seeing the output task finish before the input task throws an error shows that the error is, in fact, being caused because the input task is using the clock from the output task, and this clock is stopping unexpectedly. If we can figure out why the output clock is stopping, or if we can perhaps change the program so that the input clock uses its own onboard clock and the output task uses the input task's sample clock, it may help to resolve the problem.

 

Please let me know what the results are of running the attached code and trying the above suggestions. I also saw that you mentioned another thread that you were working on this issue with. I was wondering if you could provide a link to that thread as well. Thanks, and I look forward to hearing back soon!

Daniel S.
National Instruments
0 Kudos
Message 6 of 10
(4,497 Views)

Hi Daniel,

 

First of all thank you so much for your support.  I updated my application similar to your code and found the following behavior:

 

1) If I included the "Is task done?" subVI inside the loop to check the output task, I didnt get any data reading back and I would get error 200279 or error 200016. It seems the subVI slowed down the loop quite a lot. Error 200279 was still a DAQmx Read error. Not sure if 200016 is from the output task?

 

2) If I didnt include the "Is task done?" subVI inside the loop for checking the output task, I would get corrent data read back for a short while and stopped by error 200284.

 

Both 1) and 2) are performed with similar error handling as shown in your sample code.

 

Pleast look at the following link for my other thread:

 http://forums.ni.com/ni/board/message?board.id=170&message.id=387032&query.id=97807#M387032  

 

hope to hear your suggestions again,

many thanks.

 

Bryan 

0 Kudos
Message 7 of 10
(4,484 Views)

Hi Bryan,

 

Thanks for the update. Regarding the errors -200279 and -200016, these are both errors due to the board running at a faster rate than what the computer is taking data off (reading) and putting data on (writing) the board. I believe that changing your DAQmx Read from 1 Sample to N Samples should help this error from occurring.

 

I have discussed this issue with another engineer that I believe is working with you on the issue and we have run the code I linked with a USB-6259 on his system. We found that when reading a single sample at a time, we would also receive the -200279 error as we were not emptying the buffer on the device fast enough to keep it from being overwritten. We then changed the DAQmx Read to read N Samples at a time and we found that we could run the code without ever receiving the -200284 error (or any other error). I believe the engineer has attempted to call you but was unable to reach you. It would be ideal if you could call him back at 1-866-275-6964 and reference your service number. Please let me know if you are unable to reach him or if there are any additional updates you have regarding this issue. Thanks!

Daniel S.
National Instruments
0 Kudos
Message 8 of 10
(4,467 Views)

Hi Bryan,

 

I have the similar problem except that I am using a USB-6211. I only use two AIs for differential mode. Please see attached configuration codes for the daq.

 

Usually, the daq can sample data for 20 minutes or so and suddenely stops. As you described here, the DAQmx Base read is always the problem and shows the error 200284. Efforts have been put into changig the timeout and sample rates but it doesn't help at all. It seems that the error will show up independent how fast the sample rate and how many samples per channel. 

 

Let me know if you have solved this problem. 

 

-John

0 Kudos
Message 9 of 10
(3,853 Views)

Hi Danial,

 

 

I have the similar problem with him except that I am using a USB-6211. I only use two AIs for differential mode. Please see attached configuration codes for the daq.

 

Usually, the daq can sample data for 20 minutes or so and suddenely stops. As you described here, the DAQmx Base read is always the problem and shows the error 200284. Efforts have been put into changig the timeout and sample rates but it doesn't help at all. It seems that the error will show up independent how fast the sample rate and how many samples per channel. 

 

Let me know if you have solved this problem. 

 

-John

0 Kudos
Message 10 of 10
(3,852 Views)