Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Does the polling fast enough

Solved!
Go to solution

I use 9229 (usb case) to collect 4CH data simultaneously with 10 seconds duration.

 

Since there is no memory in USB case, I use the attached vi to polling data from 9229 continusly.

 

But I am not sure if the polling is fast enough, so that their is no gap or data lost between each polling.

Is there any way to verify it?

 

No matter what value I set to sampling rate and data length, it can only poll back 256 data point (double) each time.

If the sampling rate is 50k, the 256 points will last for 5ms. I am not sure if my PC is fast enough.

 

Any suggestion? Thanks.

Message Edited by turbot on 01-06-2009 12:04 AM
0 Kudos
Message 1 of 19
(5,343 Views)
Solution
Accepted by alex.

Hi Turbot,

 

Thanks for the post and I hope your well today.

 

The9229 Data rate range (fs) is:
Minimum....................................1.613 kS/s
Maximum................................... 50 kS/s 

 

I'm not sure why your polling?

 

Can't you setup up a DAQ task to continously acquire and rate of 50kS/s. You are right, the polling method would be difficult to get data every 5ms..in the sense of being accurate.

 

Have you also considered the producer/consumer architecture which allows you to acquire data a constant rate by placing the processing of the data acquired into a second parallel loop?

 

Hope this helps, 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 19
(5,334 Views)

How to setup up a DAQ task to continously acquire and rate of 50kS/s. I am trying to do so in the attached vi of the first post. But the polling loop is existing. There may be gap between each loop.

 

 

May you give any details of  producer/consumer architecture. Now I have 2 loops. One for data collecting, one for data processing as the first attachment.

 

0 Kudos
Message 3 of 19
(5,305 Views)

Hi Turbot,

 

Thanks for the reply and I hope your well today.

 

 Your architecture seems very good and almost correct. (you have the produce /consumer setup). Two pointers:

 1.  I would not advice having a 1ms wait until next multiple. I would set it to 10ms. A windows machine can't poll at that rate - as the jitter of a windows machine is a few ms and then the time it would take to action the read would also take sometime. This will only make the buffer(the points read) larger. 

2. You do not require timing in the second loop, as this only iterates when an itme appears in the queue. 

 

Let me know if this helps, 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 4 of 19
(5,301 Views)
I am using the USB casing with 9229, no matter how long I set to the data length to collect, I can only get 250 points in the first loop. Any suggestion?
0 Kudos
Message 5 of 19
(5,299 Views)

Hi Turbot,

 

Thanks for your posts

here: and here.

I would like to remind you that you should not post multiple times for the same issue.

 

I am in the process of getting a USB DAQmx Carreir to test things out on. However, it would appear that your code is correct. 

 

1. In MAX if you run a test panel with the same settings i.e.  Number of samples of 20k and Sample Rate of 10k does it work? Currently, under simulated devices this works fine for me. If you get an error - then there could be an error with what we're requesting. If this does work, then its an issue with the code. 

 

2. I would then ask if you could try some NI Example code which can be found in the NI Example Finder (Help>>Find Examples..). I would suggest trying  Cont Acq&Graph Voltage - Int Clk.vi

 

3. What version of DAQmx are you using?

 

*****

You have just now posted on 9161 VS 9162 Any difference - and I will answer here. 

 

I would recommend read this post Buffer Size USB 6009 -which explains about buffers. 

 

I beleive that  9229 has a buffer of 2048samples.. youcan find the information your looking for ni.com, search the device and look up the specification.

 

Let me know what you think (in this post),

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 6 of 19
(5,263 Views)

I am using 9229+9162 ( usb carrier ). But no documents for FIFO on them.

 

Can USB Bulk transfer data to PC's memory bypass the PC's CPU like DMA.

 

By using 9229+9162, the default buffer size is 100k. But I can only get 250x4CH samples MAX, and I tried to set the buffer size on PC memory but failed. Any suggestion?

 

 

0 Kudos
Message 7 of 19
(5,224 Views)
Hi Turbot,



USB device uses USB bulk to transfer data by default, and it doesn't support DMA.

I'm not very sure what you've been done, but the suggestion when you tried to sampling in continuous sample mode is to set sample to read to 25-50% of sampling rate.

If this doesn't solve the problem, showing us error screenshot, and how do you configure task in MAX would be helpful.



Regards, Kate
Message 8 of 19
(5,201 Views)

Thanks, what's the meaning of 'to set sample to read to 25-50% of sampling rate',

 

By using 9239+9162(usb carrier), I am trying to collect 4CH data simultaneously at 50k/s with 10 seconds length.

 

Not sure how does USB Bulk work, I need to confirm no data lost or gap in transfer from 9239 to  9162, 9162 to PC's memory, PC's memory to my application. Any suggestion?

0 Kudos
Message 9 of 19
(5,198 Views)
Hi Turbot,



There's no data lost as long as you acquire in continuous sample mode, since all data will be kept on the module before sending to PC.

The only problem you'll face is that you don't pull data out fast enough, and cause a new data over-written an old data.

However, an error will be alerted in this case, and the program will be stop, if you perform an error handling.

To prevent this problem, set sample to read to 25-50% of sampling rate which is 12.5-25k for 50kS/s sampling rate.

Sample to read can be set on DAQmx Read.vi.



Regards, Kate
Message 10 of 19
(5,170 Views)