Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB DAQ: Reading Data, Analyze, Writing analyzed data - not working

Solved!
Go to solution

I have Labview 2011 32-bit (no toolkits), on Windows 7.

 

Hardware: NI USB-6251 DAQ board.  I'm using analog in, analog out.

 

I am trying to collect data (read), analzye it (such as integrate or derivative) to make a new waveform (or data array)., and then output that new waveform. Just like this example:

 

http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/hwtimedsimio/

 

However, I don't have hardware timing.

 

I have tried many many things. One that worked temporarily, until the start task for write threw an error: http://i.imgur.com/as5ItdO.png

 

Another that works temporarily, but has a 7 second delay: http://i.imgur.com/VLbyZbo.png

 Ends up having this error: Warning 200015 occurred

While writing to the buffer during a regeneration, the actual data generated might have alternated between old data and new data. That is, while the driver was replacing the old pattern in the buffer with the new pattern, the device might have generated a portion of new data, then a portion of old data, and then a portion of new data again.

Reduce the sample rate, use a larger buffer, or refer to documentation about DAQmx Write for information about other ways to avoid this warning.

 

Can anyone tell me what I'm missing?  It seems very simple.

 

Thank you.

Download All
0 Kudos
Message 1 of 8
(4,677 Views)

Thank you for sharing your screenshots. I would suggest using error wires to enforce data flow in your code just as it is used in the example you linked in your post. Additionally, you should use DAQmx Start before write and enforce dataflow with error wire as in your linked example. I hope this helps 

0 Kudos
Message 2 of 8
(4,626 Views)

Thank you for your reply.

 

Here is the result for making the changes you suggested, attached.

 

The error is: Error -201025 occurred at DAQmx Start Task.vi:2

Possible reason(s):

Non-buffered hardware-timed operations are not supported for this device and Channel Type.

Set the Buffer Size to greater than 0, do not configure Sample Clock timing, or set Sample Timing Type to On Demand.

 

0 Kudos
Message 3 of 8
(4,622 Views)
Solution
Accepted by topic author atomphotonics

Thanks for an update. Sorry i have missed that you are using USB daq device and that is the reason why we are seeing this error

 

http://digital.ni.com/public.nsf/allkb/EC1968728E660B288625780700570D06?OpenDocument

 

In general, when you receive errors like this they will give you pretty good hint on what is going on. Therefore, you can try to remove daqmx timming from your AO task or try to set buffer size .

This might help

http://digital.ni.com/public.nsf/allkb/E1E67695E76BA75B86256DB1004E9B07

Message 4 of 8
(4,598 Views)

Removing the sample clock for Write seemed to fix it.  Now I can write out the data I read in.  But I haven't even analyzed the data in between yet, and I am getting a very large delay between original signal and output signal.

 

With a sample rate of 1000, and 50 samples, I get a delay of about 50 ms.  If I increase the # of samples, the delay gets larger, with gaps in the data output. 

 

Two questions: Am I hitting a fundamental limitation of the USB DAQ board?  Can the input/output be synchronized while not using a sample clock on the Write?   (or should I make a new thread about this?)

 

Thanks.

 

New code image attached.

Oscilloscope trace attached (blue (ch2) is original signal from detector, purple (ch3) is low sample data output from labview, scope triggered on original signal)

 

Download All
0 Kudos
Message 5 of 8
(4,586 Views)

Hi,

 

Since we are doing software time calculation of data there will be some delay. What kind of input/output synchronization are you looking for? … specific maximum delay time? 

0 Kudos
Message 6 of 8
(4,553 Views)

I was hoping for less than 10 ms delay.  As minimal as possible is ideal.  Is 1 ms possible?

 

This is for a feedback/control system - and large delays don't work - the system changes faster than a 10 ms scale.

0 Kudos
Message 7 of 8
(4,543 Views)

Hi,

 

I am afraid what you are trying to accomplish with this USB device is not possible. I would recommend looking at compactRIO devices.  Please take a look at the page below. I think this will be perfect fit for your application

 

http://www.ni.com/compactrio/whychoose/

0 Kudos
Message 8 of 8
(4,529 Views)