Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to ignore DAQmx overwite error 200279?

I got error (200279) from DAQmx task while I continuously sample data. I think the error occurs due to high window process load which delays analysis process of my program. I understand that I lost data while I process my analysis. Please see the attached image that shows the error message.

 

I would like to know how to ignore the error. I am using Measurement Studio with C#. I tried try and catch method, but it is not very effective. I think there should be DAQmx option that ignores lost data.

 

I know that I can try to increase buffer and reduce samples, but it is not very safe for everyday running application.

 

Thank you.

0 Kudos
Message 1 of 7
(9,832 Views)

SM Instruments,

You should be able to set some DAQmx Read Properties to allow unread data to be overwritten.  The first property is OverWrite Mode, which must be set to DAQmx_Val_OverwriteUnreadSamps.  The acquisition will then continue to overwrite the unread samples with new ones.  The next step is to use the RelativeTo and Offset properties to always read in the most recent group of samples acquired.  The details of setting all of these properties can be found in the NI-DAQmx C Reference Help under NI-DAQmx C Properties > List of Read Properties.

Hope this helps!

Thanks,
Justin M
Applications Engineer
National Instruments

Message 2 of 7
(9,806 Views)

Justin,

Thank you for the suggestion, but could you please elaborate on the proper use of RelativeTo and Offset properties?

I am working on the same issue using PCI-6143 and LabVIEW 7.1. My program reads 16k samples per iteration at 250kS/sec.

I have set RelativeTo to "Most recent sample" and Offset to "-16,384".

On every iteration I get error -200277: "Invalid combination of position and offset. The position and offset specified a sample prior to the first sample acquired (sample 0). Make sure any negative read offset specified will select a valid sample when combined with the read position."

Thanks!  Zador.

0 Kudos
Message 3 of 7
(9,788 Views)
Thank you for your reply Justin.
 
I tired to use 'Read Most Recent' option. I just changed 'RelativeTo' property and succeeded in reading without error. However, after I changed the property, the sample period became slow. My sample rate was 4096 and number of sample was 512. It should read buffer 8 times per a second, but it read 4 times per a second after I changed the property. That means I lost half of my data.
 
Thank you.
 
 
0 Kudos
Message 4 of 7
(9,782 Views)
About my post above: it was just a dumb mistake on my part. I was reinitalizing the task after every error, thus never giving the buffer a chance to fill. My solution is to ignore all 200277 errors. It would probably be also sufficient to ignore the error for the first iteration or two only.
 
SM Instruments,
I don't see any slowdown in my application. If you haven't set the Offset property yet, do set it to -512. You may be forcing your task to discard some of the data. Good luck!
 
Zador  
0 Kudos
Message 5 of 7
(9,775 Views)
One more comment:
 
When DAQmx is configured to read data relative to and preceding the last sample acquired, DAQmx Read appears to read a portion of the old data in addition to the fresh samples acquired since the previous read.
 
What I do now is dynamically change the read position depending on how well the data reads manage to keep up with the data acquisition. The following LabVIEW vi illustrates the idea (to be called just before DAQmx Read).
 
It first checks the number of fresh samples available (TotalSampPerChanAcquired - CurrReadPos), then sets the read position as follows 
 
If "samples available" <= "samples to read" then RelativeTo = Current Read Position and Offset = 0,
else RelativeTo = Most Recent Sample and Offset = -"samples to read". 
 
Works well for me.
 
Zador
Message 6 of 7
(9,748 Views)

Hi Zador-

Thanks for sharing- that's a really useful algorithm to determine the read offsetSmiley Happy

Tom W
National Instruments
0 Kudos
Message 7 of 7
(9,728 Views)