08-07-2012 03:14 PM
OK, Thanks. I was trying that in the attached VI but got stuck as to how to parse the correct values out. I changed the +/- limit from 5 to 2 as you can see in the attached VI. How do I stop the scan as soon as I find the correct x,y data and move onto the next item in the original Array i.e, as soon as I find the value satisifying the limit for 120 (i.e. the 118 x-value), I capture that data and then move onto the second item in the Array 161.088??
Thanks,
hiNI
08-07-2012 03:32 PM
Replace the inside FOR loop with WHILE loop.
08-07-2012 05:13 PM
Hello,
I got it to work but would like to increase the complexity a bit. There are instances where the scanned x-data value may be closer to the value in the previous or next item. For example, in the below snapshot of the txt data file, if I am scanning for 161.088, the closest value is 161.251:
161.255 | -0.5907 |
161.251 | -0.59145 |
162.125 | -0.58748 |
In another snapshot, the cloest value while scanning for 325.248 from:
324 | -0.891 |
324.875 | -0.872 |
325.75 | -0.882 |
is 324.875
I am just trying to extract the closest data point. If I use a less than equal comparison, I do not always get the closest value. Also, the difference between the "scanning for value" and the Array value varies. How can I go about getting the closest value from the text file.
08-08-2012 08:52 AM
Hello,
I would like some help to extract the closest value from the txt file that corresponds to a given fixed array.
For example, in the below snapshot of the txt data file, if I am scanning for 161.088, the closest value is 161.251:
161.255 | -0.5907 |
161.251 | -0.59145 |
162.125 | -0.58748 |
In another snapshot, the cloest value while scanning for 325.248 from:
324 | -0.891 |
324.875 | -0.872 |
325.75 | -0.882 |
is 324.875
I am just trying to extract the closest data point. If I use a less than equal comparison, I do not always get the closest value. Also, the difference between the "scanning for value" and the Array value varies. How can I go about getting the closest value from the text file.
Any help will be sincerely appreciated.
Thanks,
hiNi.
08-08-2012 08:59 AM - edited 08-08-2012 09:00 AM
@hiNI wrote:
I am just trying to extract the closest data point.