High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger Problem with PXIe 5122 (re-arm time)

Hello all,

 

I try to use the PXI2 5122 digitizer to acquire data. What I would like to do is acquiring 1000 points after trigger. The Trigger frequency is between 100Hz and 10kHz, depending on the application.

The problem is the program seemed to miss some trigger. If I run it with a 10kHz Trigger and acquire 1000 points (16Bit 10MS/s) I should have 20MB/s but I am saving just around 2MB/s. So I suppose the 5122 Card is not getting every Trigger event it should get. I set the Trigger Holdoff to 0. The rearm time of the 5122 should be fast enough to catch every Trigger event. I attached the slightly modified code of the vi.

 

It would be great if somebody would knew the answer!

 

Thanks!

0 Kudos
Message 1 of 5
(6,264 Views)

Hi Alex,

 

Can you attach the actual VI for me to look at? I am curious how many records you specify, and what your record length and reference position are. By default, reference position is 50% so half your samples will be before the trigger and the other half after the trigger (if you set it to 0, all the samples will be after the trigger). Also, I am thinking the method you are using to fetch the data is not quite what you are expecting. In your image, it shows that you are fetching in a loop, but you are always specifying the Fetch Record Number to 0, which means that you will be fetching duplicate records everytime. Since your Fetch Number of Records is set to -1, you will fetch all available records each loop. However, you will always start at record 0 and then fetch all the records.

 

Eventually, once you fill up the onboard memory, you would likely get an error saying that you are trying to fetch a record that has been overwritten because when Enable Records > Memory is set to True, the digitizer will begin to overwrite old records once the memory is full. Of course, this is all assuming you are specifying a very large number of records that will take more than the memory of your card and you are setting the Records > Memory to True. Can you examine your data and determine that you are fetching duplicate records each time (I would assume each loop you are getting more and more records per fetch as the acquisition keeps running)? Also, I cannot tell how you are dequeuing the data and writing it to file, so it is hard to tell if something unexpected might be happening there as well. Does the Records Done property ever return the number of records you would expect based on how many records you are telling the digitizer to acquire?

 

Regards,  

Daniel S.
National Instruments
0 Kudos
Message 2 of 5
(6,261 Views)

Hi Daniel,

 

thanks a lot for your fast help.

 

I attached the vi (slightly modified NI example). I changed the reference position to 0 and fetch relative to Trigger.

But I´m still not getting every event I want to measure. Now I get more events than I want to measure.

 

Thanks

Alex

0 Kudos
Message 3 of 5
(6,253 Views)

Hi Alex,

 

You are specifying to fetch 5 records at a time (Fetch Number of Records) but you are not specifying which records to fetch within the loop (Fetch Record Number). Thus, it will use the default each time, which is 0. What this means is that you are fetching 5 records every loop, starting at record 0 and ending at record 4, and you are fetching the exact same 5 records every single time, over and over. In order to fetch all of your records, you need to increment the Fetch Record Number value according to how many records you are fetching each time. The best way to do this would be to multiply the while loop's increment terminal by the value you set Fetch Number of Records to be.

 

For example, the first iteration value will be 0, so the multiplication result will be 0 and you will fetch the first 5 records numbered 0-5. The next iteration will multiply 1 times 5 so you will start fetching at record 5 (record 4 was the last you fetched in the previous loop) and get the next 5 records (numbered 5-9). The next iteration will multiply 2 times 5 and so you will fetch starting at 10 through 14, and so on and so forth.

 

Also, Records Done tells you how many records the digitizer has acquired and is completely independent of the number that you have fetched. You should never iterate this value as that iterated value would not tell you anything useful. Each time it is queried, the value is current, and at some point, since the number of records you can fetch is finite, it will reach its maximum value and stay there. In order to track how many samples you have already fetched, you should increment based on the value you are setting the Fetch record Number to, or simply read the size of the fetched waveform array and increment that value to tell you what you have already fetched. You will want to do some sort of comparison of the number you have fetched (not acquired) versus how many total records you specified so that you know when to stop your while loop. As it is now, your loop will run forever and just keep fetching the same 5 records over and over (until you manually stop it). This is probably why it appears that you are getting too many records.

 

I also wanted to point out that since your reference position is 0, you have no pretrigger samples, and so fetching relative to trigger does not change anything from the default behavior (which is relative to pretrigger).

 

Regards, 

Daniel S.
National Instruments
0 Kudos
Message 4 of 5
(6,224 Views)

i want to know :if the fetch number of records is 5,does dma interrupt happens once for 5 records or five times for each record in a loop?

I believe in God!
0 Kudos
Message 5 of 5
(6,198 Views)