Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

CRIO High Speed multi-channel acquisition for several minutes stream to disk

Hi,
I'm using a CompactRIO with the cRIO-9215 4 channel simulataneous Analog input modules. (I will buy 4 or more)
 
I would like to scan 8 or 16 channels (later maybe more) at 10KHZ or better for 2 to 5 minutes, This must be saved to disk.
 
Can I do this on the CompactRIO without the FPGA?
 
Is there a good demo program for this?

Thanks!

Jeff Scharpf
 
0 Kudos
Message 1 of 10
(19,988 Views)

Thank you for your question.  With cRIO, you will need to program the FPGA to get data flow from the 9215 to the host RT controller, and then to the host Windows Controller.  Here is a link to an excellent tutorial on the basics of LabVIEW FPGA, which includes transferring data to the RT controller:

http://zone.ni.com/devzone/conceptd.nsf/webmain/62B388DB80B557028625703700639B89

There is a USB based 9215 which can transfer data very rapidly to the host windows computer using standard DAQmx function calls from LabVIEW or LabWindows.  This may be an easier to implement option for you. 
 
 
Hope this helps you get started. 
Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 2 of 10
(19,983 Views)
This tutorial should als prove quite useful:

http://zone.ni.com/devzone/conceptd.nsf/webmain/8E999A74E43AC76186256F5E0068CFAC
Developing High Speed Continuous Buffered Data Acquisition Applications with CompactRIO



Richard

Field Sales Engineer, New Jersey
National Instruments
0 Kudos
Message 3 of 10
(19,978 Views)

Thanks for the replies. I see that in order to use the CRIO I MUST use the FPGA. I will look at that example.

 


Regarding the USB module, since I need 16 channels, would I need to buy 4 of those units and plug in to 4 USB ports? How would this affect throughput?
I've had bad luck with USB data acq. , both NI and others.. not sure why but usually when doing high speed data.

 

Regards

 

jeff

0 Kudos
Message 4 of 10
(19,975 Views)
USB 2.0 has a maximum speed of 480Mbits/second. A double data point (floating point) is 64 bits. The USB bus shares this bandwidth, so having more devices plugged in means less throughput per device. Some PCs have two separate USB "hubs", I believe this would mean that you have 480Mb/s on each separate hub.



Richard

Field Sales Engineer, New Jersey
National Instruments
0 Kudos
Message 5 of 10
(19,972 Views)

Thanks for all the help.

I've been able to get the examples to work but I have only one problem. I can't seem to get the acquisition speeds that I should get. There is another example called recommended by the NI support crew called "CompactRIO Continuous Buffered Readings" which is a good example, but when I try to set the acquisition to 10KHZ, it doesn't appear to acquire at that rate. I feed a sine wave in and it appears to alias. When I slow it down to 100HZ then it appears ok. (I'm  trying to acquire at 10KHZ on all channels).

 Is there a way to confirm the actual acquisition rate?

I'm a little frustrated with this and not sure what to do.

 

I appreciate any help.

 

Thank you,

 

Jeff

0 Kudos
Message 6 of 10
(19,966 Views)
Hi Jeff,

Do you notice the scan backlog on your RT application climbing? This would be a good indicator of wether the FPGA is too slow or if the RT program is too slow. The best RT performance is going to come from replacing the RT program's controls and indicators with FIFO's, these would then communicate in the Normal Priority Loop over TCP to the desktop PC host.

To benchmark the FPGA program, you can ask for a tick count before and after the analog in loop of the FPGA software. If this bottoms out at some value, then that would be a lower limit for speed.
Richard

Field Sales Engineer, New Jersey
National Instruments
0 Kudos
Message 7 of 10
(19,828 Views)

Hello Jeff,

Without DMA support to transfer the data from the FPGA to the LabVIEW Real-Time host, you will not be able to achieve the transfer rate required for your application. Without DMA the maximum effective continuous data transfer rate you can achieve is about 100 kB/s. The exact rate depends on the amount of data processing and handling you need to do in you LabVIEW RT host application.

DMA data transfer from FPGA to RT host is not supported in LabVIEW FPGA 7.1, but is a new feature added in LabVIEW 8. You will not need to change any of your hardware for this to work. You can get more information about the new features in LabVIEW FPGA 8 at the following location.

http://www.ni.com/labview/upgrade.htm

Message Edited by Christian L on 10-31-2005 10:16 AM

authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 8 of 10
(19,800 Views)

Thanks for the replies.

An update. I just upgraded to LV8. Beginning some benchmarking now using DMA. So far with 8 analog input channels, I'm maxing out at about 43K samples per second (on each of 8 channels). This is about 8 or 9 times faster than with LV7, so I'm VERY happy! The only thing I don't know is if I'm doing it correctly or if there is a more efficient method. I started with the demo program available here and messed around with things such as FIFO size, (on both the Host and FPGA), channel count, number of samples to read, etc..

I'm a little confused as to what values should be used for FIFO size on either the host or FPGA. Not a big deal since it works great right now.

 

My next benchmark will be to stream the data to disk. Is it easy to convert the binary streaming data demo from FIFO to DMA?


Thanks!

Jeff

0 Kudos
Message 9 of 10
(19,621 Views)
Hi Jeff,

Here's a new DevZone on using DMA instead of Host-Interface palette.
http://zone.ni.com/devzone/conceptd.nsf/webmain/0B5FF8ED662652EE8625708C00548ED8

The only thing I recommend to make it a more efficient transfer is to make sure you are putting 32 bits into the FIFO each time. There are functions in LabVIEW which allow you to take two 16-bit numbers and put them into one 32-bit number. They are on the Advanced>>Data Manipulation palette.

To convert from FIFO to DMA, one needs only configure the FIFO for DMA. Keep in mind that before DMA, two loops were needed. Now, only one loop is needed since the data goes directly onto the Bus. So the architecture may not be appropriate for DMA FIFO's.

Richard

Richard

Field Sales Engineer, New Jersey
National Instruments
0 Kudos
Message 10 of 10
(19,587 Views)