LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to record output voltage when program detects peak?

My application involves ramping an output voltage to a laser and recording an etalon trace. I need to record the voltage output when the program detects a peak in the etalon trace. I am currently trying to use an occurence to record the voltage when a peak is detected. Is this the best way to do this? I am new to Labview and programming in general. Any suggestions would be helpful.
0 Kudos
Message 1 of 3
(2,265 Views)
You won't know if it's a peak until, uh, it starts to go down again. So in principle you test for the maximum of the data set.

Given that usually there's noise you might get better results using peak detector.vi or maybe the point by point version. Never used occurrences myself and I'm not sure this is a good application to start with.
0 Kudos
Message 2 of 3
(2,253 Views)
Hello Lou,

It sounds as if you have already determined the algorithm for detecting the peak of the etalon trace. Is this correct? If so then you will have some condition at which you would like to "record" the output value. If you've already got this done, then there may be a better way to proceed than using an occurrence.

You mentioned that you will be recording the output value for a given etalon input value. In what way are you creating a record? Are you writing these values to file or simply creating an array to display on the front panel? In any case, I will assume that you need a data acquisition loop and a "recording" loop. I would recommend using a queue for this operation. If you take a look at the producer / consumer (data) design template, you will see how this process works. Essentially under a given condition, your peak detected condition, you will send data from the data acquisition loop down to the "record" loop. In this loop you can be writing to file or processing these data points however you'd like. Please post back and let me know if this helpful for you, or if I have misunderstood your question. Thanks,

Mike D.
0 Kudos
Message 3 of 3
(2,242 Views)