FJ_Sanchez Posted October 29, 2015 Report Share Posted October 29, 2015 Hello, 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. Quote Link to comment
CraigC Posted October 29, 2015 Report Share Posted October 29, 2015 (edited) Hi 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. Craig Edited October 29, 2015 by CraigC Quote Link to comment
FJ_Sanchez Posted October 29, 2015 Author Report Share Posted October 29, 2015 Can you explain the utility of the reset function? I don't understand this parameter of the VI... Quote Link to comment
CraigC Posted October 30, 2015 Report Share Posted October 30, 2015 (edited) 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" Craig Trigger Reset.vi Edited October 30, 2015 by CraigC 2 Quote Link to comment
FJ_Sanchez Posted November 2, 2015 Author Report Share Posted November 2, 2015 Thank you Craig, that makes sense to me now. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.