LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pretrigger

Hello,

I'm doing a project where I'm recording the postrigger and pretrigger of a signal. I can record postrigger samples continously. My problem is that I would like to recording prettrigger samples continously but I can't do it with Labview.

Any suggests will be helpful.

Thank you.

Pedro

0 Kudos
Message 1 of 3
(2,777 Views)

By "pretrigger" samples, I presume you mean "N samples that occur before the trigger signal".  The way to do this in LabVIEW is to use a circular buffer of length N (a circular buffer means that when you put the N+1 element in, the first one is thrown out, leaving N elements, and a new insertion point that "goes around in a circle", position 1, 2, ..., N-1, N, 1, 2, ...).  During the Pre-trigger period, you simply fill the circular buffer.  When the Trigger occurs, you "switch gears" and start filling a "Per-trigger buffer", handing the Pre-Trigger buffer off to be saved as the "Pre-Trigger samples".  You subsequently save the Per-trigger buffer after it has acquired the appropriate samples (if you are saving until you get the "Post-Trigger", you might want to put these latter samples into a Queue and start dequeuing as soon as the Pre-Trigger samples have been saved and continuing until the Post-Trigger has been detected).

 

Bob Schor

 

P.S. -- two techniques to create/manage circular buffers are

  1. Create a cluster consisting of an Array of size N and an Index to "next Entry" that you increment modulo N.
  2. Create a Queue of size N and do a Lossy Enqueue (which pushes the "oldest" element off the end when the Queue gets full so you can keep adding elements). 
0 Kudos
Message 2 of 3
(2,753 Views)

What Bob said is the way to do this. If you are having trouble fitting this concept in to your code, please share you code so we can see what you are working with.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 3 of 3
(2,742 Views)