From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

PXIe-5122 Multi-Record 2 Channel Sample Rate

I need some suggestions on how to increase the average sampling rate for a multi-record acquisition.  The hardware is a PXIe-1073 chassis with a PXIe-5122 digitizer.  I'm triggering off a digital edge at 90kHz and acquiring 2 channels of data simultaneously at 100MS/s.  I'm finding that the fetches can't keep up above 140 samples per trigger per channel. 

 

When sampling a single channel I can easily keep up with the data at 500 samples per channel.  I've tried changing the number of records fetched at one time, switched to fetching unscaled 16-bit samples and I've set the acquire more samples than memory attribute.  I'm programming ni-scope in c starting with the "multi-record fetch more than available memory" example.  Is there anything else I can do to get the data off the board at a higher rate?

 

Thanks,

Mike

0 Kudos
Message 1 of 14
(6,827 Views)

Hi Mike,

 

The 5122 is a simultaneous card, meaning both channels have their own ADC capable of 100MS/s. What you are able to do for one channel should also be possible for two. I have a few questions for you regarding your setup that will help us get a better understanding of the issue.

 

 

  • Are you using the internal sample clock? (I assume so)
  • Is your digital trigger a start trigger?
  • What memory/channel does your card have? (8MB/ch, 32MB/ch, 256?)
You say that your card is unable to keep up with more than 140 samples per channel when using two channels. Are you receiving any kind of error when going beyond this number? If so, could you give us the error code that you receive?
Finally, I want to make sure I fully understand your setup. You have a digital pulse train coming into your card at 90kHz, and you are triggering a fetch off every rising edge. So, this means you are trying to acquire 500 samples/chan on two channels at a rate of 90kHz (90,000 times a second)?
 
I recommend you take a look at the fetch multiple record example code that comes with the NI-SCOPE driver. If you navigate to (Start -> Programs -> National Instruments -> NI-SCOPE -> Examples), you will see a C folder full of C
code examples. If you haven't already, you might want to take a look at the "MultiRecord" and "MultiRecordFetchMoreThanAvailable" examples.
Le tme know if you have any questions, I look forward to your response! 

 

Micah M.
National Instruments
NIC AE Specialist - Test
0 Kudos
Message 2 of 14
(6,806 Views)

Hi Micah,

 

First the answers to your questions:

 

  • Yes, I am using the internal sample clock (100MS/s)
  • digital start trigger
  • 64 MB/ch

here is the error:


Ni-Scope Error: Error BFFA499A.

Possible Reasons:
Acquisition has been stopped to prevent an input buffer overwrite. Your application

was unable to read samples from the buffer fast enough to prevent new samples

from overwriting unread data.

 

Your understanding of my setup is correct, the digital pulses are coming in on PFI0 at a rate of 90kHz.

I did base my program off of the "MultiRecordFetchMoreThan Available" example which I modified to allow for

two channels as well as fetching more than one record at a time.  Typically I find I can improve the transfer speed

by increasing the number of records I fetch until about 2000 records per fetch or so, after that there is very little improvement.

Thanks for your help.

Mike

 

0 Kudos
Message 3 of 14
(6,800 Views)

Thanks for the additional info Mike. I am sorry to make you do this, but the error code you gave me does not pull up any information (it is usually a decimal number). Could you please take a screenshot of your error and attach it to this forum thread?

 

I also spoke with some colleagues and have a few more follow up questions:

 

 

  • What is your record length set to? (# samples/record - is this what you mean by 500 samples?)
  • How long into your code does this error occur? Is it able to run a while or is it instantly?
  • How did you go about modifying this code for two channels? Since it works for one channel, I find it strange that we are running into a problem with two channels. When it is just the one channel, are you able to run it forever (or until your PC runs out of RAM) or will it too error out after a much longer time?
As the error message indicates, you are not fetching data off the card fast enough and the circular buffer begins to overwrite itself. As I am sure you know - increasing record size, fetching more records, or fetching them faster are the main ways of avoiding this kind of error. If you could, please attach a screenshot of your error and I will be able to find some of its likely causes. Thanks!  

 

Micah M.
National Instruments
NIC AE Specialist - Test
0 Kudos
Message 4 of 14
(6,771 Views)

Hi Micah,

 

The error code is:   -1074116198

 

I've tried different record lengths, by which I mean the number of samples per record for each channel.  Right now I can only get 140 samples per record.  I'm not sure what the proper terminology is for a record but this would be 140 samples for each channel so 280 samples for each trigger if you count both channels.  For a single channel acquisition I can use a record length of 500 samples and have the acquisition run indefinitely.

 

I think the problem may be with the way the digitizer handles multiple record acquisitions.  If I understand correctly how to calculate the size of each record on onboard memory, it is  (record length x 2 bytes/samp) + 200 bytes rounded up to the nearest multiple of 128 bytes and for two channels it would be twice this amount.  So for example, if my record length is 220 samples then for each channel, the memory would be 220x2 + 200 = 640 bytes  which is 5x128.  This would mean for each trigger, I need to fetch 1280 bytes.  With my trigger rate at 90khz, that comes out to about 110 MB/s.  By the same reasoning, if I perform a single channel acquisition with a record length of 500 samples,  then with each trigger, I fetch 500x2 +200 = 1200 bytes which comes to 103 MB/s.  Like I said, I have no trouble doing one channel with a 500 sample record length.  Is this the correct way to analyze this?

 

I will include below a few of the pertinent function calls from my program:

 

niScope_SetAttributeViBoolean(vi, VI_NULL, NISCOPE_ATTR_ALLOW_MORE_RECORDS_THAN_MEMORY, VI_TRUE)

niScope_SetAttributeViBoolean( vi, VI_NULL, NISCOPE_ATTR_REF_TRIG_TDC_ENABLE, VI_FALSE)

(had to disable TDC or I was missing triggers)

niScope_SetAttributeViInt32 ( vi, VI_NULL, NISCOPE_ATTR_FETCH_NUM_RECORDS, N_FETCHSIZE)

(set up to fetch more than one record per fetch, specifically N_FETCHSIZE records per fetch)

 

for the waveform memory allocation, I set the number of waveforms to N_FETCHSIZE x (# of channels)

 

Then for niScope_ConfigureHorizontalTiming, I set the number of records to the max (2147483647).

 

The fetch function is contained in a while loop where I keep a running total of the number of records fetched to set the

NISCOPE_ATTR_FETCH_RECORD_NUMBER attribute.  I also get the NISCOPE_ATTR_RECORDS_DONE so I can tell if i am keeping up with the records on the digitizer.

 

Above a record length of 143 with 2 channels and a fetch size of 100 records, the buffer starts to fill up very quickly.  I've tried increasing the fetch size up to 10000 records per fetch but after a few thousand, it doesn't make much difference, eventually I can't keep up.

 

Conversely, with one channel and 500 sample record length, I have run for 30 mins or so continuously without filling up the buffer.

 

Thanks for your help with this issue,

Mike

 

 

0 Kudos
Message 5 of 14
(6,765 Views)

Oops, I made a mistake in the previous calculation, for 500 sample record length and 1 channel, the next highest multiple of 128 should bring me to 1280 bytes per record, the same as for 220 sample record length and 2 channels yet the 2 channel scenario fails.

 

thanks,

mike

0 Kudos
Message 6 of 14
(6,764 Views)

Hi,

I found your topic while I was searching information to have a 2 channel simultaneous acquisition.

I have a PCI5122, and I'm using Labview 8.2. Can you tell me how you modified the "niScope EX Multi Record Fetch More Than Available Memory Producer Consumer" in order to have simultaneous acquisition? Could you post your .vi?

Thank you

0 Kudos
Message 7 of 14
(6,749 Views)

Hi danielevee,

 

I think that he is using C examples rather than LabVIEW VIs, but to modify the example for two channels, you just need to specify "0,1" in the channel name field (rather than just "0") and then make sure you change the fetch instance to return a 2D array of data (or 1D WDT if you are using the wwaveform data type). If you are using a producer/consumer architecture, you will likely need to change the data type constant you are wiring to your queue when you create the queue so that it expects the correct type of data from the fetch function.

 

You should not actually need to change anything else about how you configure the digitizer unless you want some of the vertical/channel properties to be different amongst the channels. Otherwise, the record lengths and total number of records for each channel will be the same, and you will fetch the same amount of samples/records from each channel when you fetch your data.

 

Regards,

Daniel S.
National Instruments
Message 8 of 14
(6,746 Views)

Thank you,

now I'm feeling stupid. But when I set the channel I didn't use a constant, I created a control instead, and in the control option I had only single channels to choose.

Thanks again!

0 Kudos
Message 9 of 14
(6,742 Views)

No worries, let us know if you have any additional questions or concerns, and best of luck!

Daniel S.
National Instruments
0 Kudos
Message 10 of 14
(6,740 Views)