High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous acqusition of data through mutliple triggering

Hi,
 
I have a PXI-5122 and a newbie of NI scope. I have been bothered by the problem of data acqusition for a long time. As I am not very effective in explaining my problem in technical terms, I thought of putting my problem in pictorial form as attached in the ppt slide. Explaining it briefly here, I need to capture the instantaneous data (1-3 data poinits) of a wave with triggering from another wave. The triggering is done whenever there is a rising slope in the triggering wave. The aim is that I can increase the number of data points per cycle and hence increase the accuracy of my captured wave by increasing the frequency of my triggering wave. Hope there is no problem understanding my problem.
 
Is there any way which I can solve the problem?
 
Regards,
lfw
0 Kudos
Message 1 of 28
(9,715 Views)

Attached is the Vi which i have made. There is no problem when my trigger wave is 1kHz and is capturing a 100Hz wave. But when I increased the trigger wave to a higher frequency, I am not getting the correct no. of points per cycle of the captured wave. For example when i increase the trigger wave to 10kHz, I am not getting 100 points per cycle of the 100Hz wave. I am getting only 10-12 points per cycle.

Pls advise on any problem with the vi.

Thanks

0 Kudos
Message 2 of 28
(9,700 Views)
Hi,
 
Sorry. My card is PXI-5922 instead of 5122.
 
Thanks all and have a happy New Year ahead.
 
Regards,
Feiwen
0 Kudos
Message 3 of 28
(9,699 Views)
Feiwen,

I looked at your VI, which uses a single-record acquisition and restarts the acquisition every time through the loop. 

Based on the description of your application, I think what you really want to do is configure a multi-record acquisition.  Each record will be triggered by a rising edge on your trigger channel.  For each record, you will acquire the specified number of points, then the hardware will re-arm itself for a new record and wait for the next trigger.  You won't have to restart each record in your software loop- the hardware will deterministically re-arm itself.

Here is some pseudocode for what your code will look like:

-------------------------------------------------

niScope init session
niScope Configure Vertical
niScope Configure Trigger Edge
niScope Configure Horizontal Timing (set the number of records to be a large number)
Open output file
niScope Initiate Acquisition
Loop
   check how many records have completed since last loop iteration
   fetch the records that have been acquired since the last loop iteration
   write the records to the output file
End loop
niScope Abort
niScope Close
Close output file

-------------------------------------------------

Here are some more things to worry about...

Since you are doing a continuous acquisition, the number of records you acquire may be very large.  They may not all fit into the device's onboard memory.  You can work around this by setting the "Enable Records > Memory" attribute to be true.  This allows the memory to work like a circular buffer- when it gets to the end, it will start storing more records at the beginning.  But remember, you have to fetch the old records out before they get overwritten.

Finally, there is a limit to how quickly you can re-trigger the device.  Another way of saying this is that the records can't be too close together in time.  If the trigger wave is oscillating too quickly, the device may miss a trigger.  For the 5922, the trigger re-arm time is (144 * sample clock period).  So the triggers cannot occur faster than this or you will miss records.

One more thing: there is an example that demonstrates some of what I have described.  Please look at "niScope EX Multi Record Fetch More Than Available Memory.vi" which is installed by the driver.

Hope this helps,

Patrick


0 Kudos
Message 4 of 28
(9,684 Views)
Hi Patrick,
 
Thanks for all the valuable advice. I have actually modified the "niScope EX Multi Record Fetch More Than Available Memory.vi" as recommended. Basically, I have added the save to file component. The vi is attached. Fortunately I am getting very positive results, in the sense that I am able to capture all the data in relative to the no. of trigger points based on the frequency of the triggering wave. However, I begain to "lost" data when I increased the frequency of the triggering wave to be more than 70kHz. I was wondering if there is anyway to increase this value.
 
Finally, I will be glad if you can answer the following questions:
 
1) I have been using the maximum sample rate 15MS/s for all my trial test. Using the formula as advised, the trigger re-arm time should be about 1e-5s. Does this mean that the frequency of the triggering wave can actually be ard 100kHz??
 
2) Is there any way I can verify that the records are actually not over written before they are fetched?
 
Thanks again for the help.
 
Regards,
lfw 
0 Kudos
Message 5 of 28
(9,670 Views)

Hello lfw,

"I begain to "lost" data when I increased the frequency of the triggering wave to be more than 70kHz. I was wondering if there is anyway to increase this value."
How can you tell that you are losing data?  At what sampling rate are you acquiring your data?

"1) I have been using the maximum sample rate 15MS/s for all my trial test. Using the formula as advised, the trigger re-arm time should be about 1e-5s. Does this mean that the frequency of the triggering wave can actually be ard 100kHz??"
The rearm time for multiple records is 144 * sample period.  If you are acquiring data at 15 MS/s, then the trigger rearm time is 9.6 us, which corresponds with a 104.167 kHz maximum trigger frequency.

"2) Is there any way I can verify that the records are actually not over written before they are fetched?"
You will not be able to fetch a record that has been overwritten.  You will receive an error if you try to do so.

Please let me know if you have any further questions

Regards,
Sean Close
Product Support Engineer: High Speed Digitizers

0 Kudos
Message 6 of 28
(9,659 Views)

lfw,

Also keep in mind the record size will affect the trigger rearm time.  As the number of samples increases, so does the time between triggers.  The 144 sample clock spec is with the minimum record size.


Jeff B.
NI R&D Group Manager
0 Kudos
Message 7 of 28
(9,644 Views)

Hi Sean,

I think that I am losing data when I am using a triggering wave higher than 70kHz because I am not getting the correct no. of records needed to plot out one cycle of the 100Hz wave. For example when i used a triggering wave of 80kHz, the no. of record i used to plot out a cycle of the 100Hz wave is only 400, whereas by calculations there should be 800 triggers per cycle and I should have 800 records. Pls correct me if my explanation is wrong.

Is there any possible reasons why I cannot reach 100khz for the triggering wave w/o losing data if my explanation is correct? I am wondering also if my save to disk function in the vi is slowing everything down. 

Thanks for all the help.

Regards,

lfw

 

0 Kudos
Message 8 of 28
(9,634 Views)

Hello lfw,

Because you are rearming for multiple triggers in hardware, your loop speed should not effect how many records per cycle you are acquiring.  Your loop speed will only determine how fast you are fetching that data from the digitizer.

How many samples are you acquiring in each record?  If you receive a trigger while you are still acquiring samples, that trigger will be ignored.  Additionally, if you are acquiring pretrigger samples when a trigger is received, that trigger will be ignored.

Try setting your record size to 1.  Do you still lose data?

Please look in the NI High Speed Digitizers Help under Fundamentals >> Triggering >> Trigger Parameters >> Trigger Holdoff for more information on this.

Regards,
Sean Close

0 Kudos
Message 9 of 28
(9,623 Views)

Hi Sean,

Everything is fine after I reduce my record size. Thanks for all the help. Really appreciate it.

Regards,

lfw

0 Kudos
Message 10 of 28
(9,612 Views)