01-24-2013 03:57 PM
Hello All,
I have a question. I am new to labview. I want to get average value of intersity of my scan that I obtained by scaning my sample through AFM. If you looked at my labview program I have four cursers which I can drag around and calculated the average value over the area. But the problem here is If I moved curser X2 the average value doesn't change. But It works fine for other cursers; as I moved other cursers average changes according to graphes average value. Plz help to correct the problem. I have attached the labview program and the file which is to used to get the average intensity. Thanks
Solved! Go to Solution.
01-25-2013 10:19 AM - edited 01-25-2013 10:27 AM
Greetings, akc;
I have opened the VI and would have a few comments.
The area of interest is being auto-indexed in a for loop. As such, the mean of a 1D Array is being calculated on every iteration (the mean of every row). That value is indexed and a 1D Array of means is created; in the VI the first value is being taken.
Instead of using the Index Array VI, use another Mean VI and calculate the mean of the 1D array.
Edit: I rewrote a few things in the post to make it easier to understand what I meant.
Simon P.
01-25-2013 01:41 PM - edited 01-25-2013 01:51 PM
Where do I start!
First of all, you only have two cursors, not four, so if you try to index out four cursors from the cursor list, you will fail!
Here's a very simple rewrite that corrects most mistakes. (I omitted the plot selection, so please add that back)
(Personally, I would use an event structure, but that would require a bit more code. Keep the original array and the selected plot in shift registers and use a proper state machine to only recalculate whats changed)
NOTES: