LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DMA writes to a SSD while continuously acquiring data from the PCI-5122.

Hi,

 

The following article from the high speed digitizer help shows how to acquire data continuously from an NI high speed digitizer card and store data to the host PC's DRAM.

 

https://www.ni.com/docs/en-US/bundle/ni-scope/page/acquiring-data-continuously.html

 

I would like to acquire data continuously from the PCI-5122 card at 100MSPS for more than an hour and store to a SATA or PCIe SSD. Could you suggest a way to perform DMA transfers from the PCI-5122 to the SSD at 200MB/s? Could I do this with labview or with a C code?

 

Thanks,

Nagaraj.

0 Kudos
Message 1 of 11
(5,065 Views)

I found this stream to disk example. I am not sure if this example applies only to a PXI controller based system or even to PCI-5122 connected to a PC motherboard.

 

https://forums.ni.com/t5/Example-Code/NI-SCOPE-Stream-to-Disk-Using-Win32-File-IO/ta-p/3996053

 

Thanks.

0 Kudos
Message 2 of 11
(5,024 Views)

The example in your second post should work fine with the PCI-5122.

 

Have you tried running one of the examples?

0 Kudos
Message 3 of 11
(4,990 Views)

I tried it today. The stream data to disk example works fine up to 50MSPS. I would ideally like to sample at 100MSPS. But when I increase the sampling rate beyond 50MSPS the onboard memory on the PCI-5122 does not seem to get emptied into the system queue. 

Download All
0 Kudos
Message 4 of 11
(4,981 Views)

I just noticed the actual sampling rate changes to 100MSPS as soon as I increase the sampling rate to anything above 50MSPS. That's probably because I am using the internal oscillator as the clock source and set it's frequency to 100MHz. And the clock source frequency probably needs to be a whole multiple of the sampling frequency. But still, I wonder why the fetch from onboard memory to the queue stalls at 100MSPS. Not even a single sample seems to get fetched onto the system queue till all the 256M sampled are acquired and fill up the onboard memory. The onboard memory on my PCI-5122 is 256M samples deep.

0 Kudos
Message 5 of 11
(4,975 Views)

Do you get the same error if you adjust the Samples Per Fetch?

0 Kudos
Message 6 of 11
(4,961 Views)

Yes. I tried reducing it upto 8x and also increasing it upto 4x. No change in behavior. Reducing the samples per fetch too much breaks even the 50MSPS acquisition. 

0 Kudos
Message 7 of 11
(4,957 Views)

Hi Nagaraj_Anan,

 

I think what's happening is that the PCI-5122 is being limited by the PCI Bus on your computer. From the 5122 datasheet:

... an NI 5122 can continuously stream data to the host computer at rates up to 110 MB/s using PCI

Since this is a 14-bit Oscilloscope, each sample takes up 2 bytes of data (padded by zeros). Therefore, when recording at 50 MS/s and trying to stream to disk, you are transferring 100 MB/s through the PCI bus, which is near the top of its capabilities. 

 

You might be able to get up to 55 MS/s, but any more than that and you will be exceeding the data transfer rate of the PCI bus on your computer, which in turn would cause your on-board memory to get overwritten before the computer can fetch data points off of it.

 

Unfortunately, although most of our scopes are specified to read at faster data rates (100 MS/s in your case), when trying to stream data other bottlenecks, like the PCI bus throughput in this case, limit the rates at which you can acquire.

Jorr-El
Systems Engineer
Testeract: Automated Test Specialists
Message 8 of 11
(4,938 Views)

Hi Jorr-el, Thanks for the reply. I guess that explains it. I guess more than the PC configuration it has probably got to do with the card not supporting the PCIe standard. It is plugged into a PCIe slot. I wish there was a PCIe equivalent of this card with similar analog specs.

 

Is there a way to speed up the PCI communication? PCI standard suggests 266MB/s with a 32 bit PCI bus clocked at 66MHz. and 133MB/s with a 32 bit PCI bus clocked at 33MHz. I am wondering if there is a way to overclock the PCI-5122 to achieve the 200MB/s needed.

 

Thanks,

Nagaraj.

0 Kudos
Message 9 of 11
(4,934 Views)

I guess the card being a two channel card will take up 200MB/s for two channels operating at 50MSPS. But theoretically if we were acquiring on only one channel we should be able to sample at 100MSPS and be able to live stream data to the SSD. Would that be a possibility?

0 Kudos
Message 10 of 11
(4,931 Views)