Jump to content

Basic level trigger detection not working as expected

Go to solution Solved by CraigC,

Recommended Posts



I am trying a very simple example using "Basic Level Trigger Detection.vi" and it is not working as expected.


I want to get the first 3 rising edges (even without hysteresis) but I always get the first one. The help says that this VI internally stores the status (I have also check that in the code) but I see when debugging that it always returns 0 in the terminal where the history should be stored.


I can workaround with my own VI or using subsets of the input signal, but is it a bug?


Thank you.


Link to post



From the LabVIEW Help File:


 "Finds the first level-crossing location in a waveform"


The Reset / History is basically saying that the last Value of the waveform is used as the first value in the waveform upon its next call.  This is an effort to help to stitch multiple Acquisitions together seamlessly.


What you are currently doing is applying the same waveform and finding the first crossing 3 times over.  You should find the first threshold then "Remove the first half of the waveform and re-evaluate for the next threshold crossing.

Something like this.




Edited by CraigC
Link to post
  • Solution

Hi,  I have tried to make a scenario to explain this better.  The main use of reset is to reset between samples or to "Stitch" together samples when in continuous mode.


In the Scenario Continuous Acquisition With Reset off the VI stores the last Array value in the 1st Sample (White) and uses it as the first Array Value in the 2nd Sample (Red).  This effectively "Stitches" together the white and red waveforms in the graph.  This helps with data processing as there is no erroneous data point in between samples.  although not that important in the time domain it can really skew frequency type stuff.


In the Scenario Single shot Acquisition I have emulated a time delay between samples.  With the reset off we can see that the VI attempts to "Stitch" together the white and red waveforms and we end up with a flase trigger.  Hence when using single shot sampling or using the same vi to sample different waveform we would want to always reset this VI in between calls.


This is illustrated in the scenario "Trigger Single shot with reset On"






Trigger Reset.vi

Edited by CraigC
  • Like 2
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.