10-28-2015 02:20 PM
What is the best way to make a look up table for about ten values?
Would making an interpolation equation require that much more processing power?
Solved! Go to Solution.
10-28-2015 02:42 PM - edited 10-28-2015 02:42 PM
A common way is to use variant attributes.
http://www.austinconsultants.co.uk/labview-tip-speedy-lut/
http://www.walkingthewires.com/2015/05/13/quick-look-up/
10-28-2015 02:52 PM
I agree with the previous post of using variant attributes for string lookups. There is also the "Interpolate 1D Array" function which might be what you are looking for if you have sorted y data that you want to interpolate. If you have X data that you want to search, you can use the "Threshold 1D array" in conjunction with the interpolation function. See attached image for example.
10-28-2015 03:27 PM
The simplest lookup table is a 1D array where the index is the key to access a given element value. Sometimes the index is obtained after a mathematical transform of the actual key.
The point of a LUT is typically that you don't need to interpolate because all possible values are in the table. Once you interpolate, you have a hybrid data structure. For example, you can get interpolated array values by entering a fractional index into "interpolate array" as mentioned earlier.
Variant attributes can be used as associative memory where the key can be any binary string, but I don't think this is what you are looking for. Interpolation is NOT possible here.
In summary, to answer your question we need more information.
10-28-2015 03:40 PM
In my program, I'm analyzing data where I get a slope, [double]. From this slope (slope will fall between 1 and about 150), I want my program to energize a component for an appropriate amount of time. (i.e. slope of 7.45 will output 5V for 8 seconds, and a slope of 12 would output 5V for 6 seconds). So y values would be integers (to dictate number of loops the AO would stay open).
10-28-2015 06:24 PM
That sounds like you will want an array and then use Threshold 1D Array to get the fractional index. Most commonly another array is used that you can use Interpolate 1D Array with that fractional index to get an actual value. You will want to round your result to get an integer number of loops to perform.
10-28-2015 06:29 PM
So you have 10 slope values in an array? Or, do you determine the slope from the values in the array?