LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make a look up table in labview?

Solved!
Go to solution

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?

 

0 Kudos
Message 1 of 7
(14,689 Views)
0 Kudos
Message 2 of 7
(14,680 Views)
Solution
Accepted by topic author smat123

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.

Message 3 of 7
(14,666 Views)
  • What is the datatype of the values?
  • What is the datatype of the lookup key?
  • What is the range of key values?

 

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.

Message 4 of 7
(14,637 Views)

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).

0 Kudos
Message 5 of 7
(14,624 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 7
(14,593 Views)

So you have 10 slope values in an array? Or, do you determine the slope from the values in the array?

Glad to answer questions. Thanks for any KUDOS or marked solutions 😉
0 Kudos
Message 7 of 7
(14,586 Views)