04-12-2009 05:10 PM
In the VI attached, each channel is measuring a certain moment of acceleration, which will be displayed as a global max on the graph. Ideally what I would like to happen is for both arrays to be searched for their highest peak (global max) and for the time difference between these two peaks to be shown on the display after the program has ended. However, what I have right now is a sort-of real time measurement. Any suggestions on going about doing this?
Thanks,
John
Solved! Go to Solution.
04-13-2009 09:57 AM
Hi Johnny,
You might try using the max index output of the Array max & min VI instead of using another VI to find the index of the maximum. Otherwise, I think you have a good grasp on the basic structure.
04-13-2009 02:29 PM
Thanks for your help Stephen!
I've made those changes, but after the highest peak from each channel occurs, the time difference indicator shows the time diff. between the two peaks only for a split second, and then the indicator returns back to zero. I would like for this max peak-max peak time difference to somehow remain on the indicator after the program has stopped running, because its value, whether it is below or above a certain constant, will need to indicate a true/false statement.
Any help is greatly appreciated.
Thanks,
John
04-13-2009 02:38 PM
Hey Johnny,
Everytime you run through the loop, you are recalculating the value of the difference. When the loop runs again, it clears the value you had before. There are tons of ways that you fix this. A lot of this depends on whether you need to analyze the data while you are in the While Loop. If you want to check this after it's done running, you can just wire the difference to the edge of the while loop and turn on indexing by right clicking on the tunnel. This will save the difference value from each iteration of the while loop. You can also save conditionally perhaps (maybe you only care about the difference if it's between some values) by writing it to a text file using the Write to Text File VIs or by building an array in a case structure. These are just some thoughts.
04-15-2009 03:21 PM - edited 04-15-2009 03:21 PM
Thank you! Wiring the difference to the edge of the while loop worked perfectly.
Johnny