Does anyone know how to implement a lookup table in labview. What I have is a list of voltages and a list of currents. And each unique combination of voltage and current needs a offset associated with it.
Voltage
10 15 20 25 30 1 X X X X X 2 X X X X X Current 3 X X X X X 4 X X X X X 5 X X X X X
So given I know the voltage and the current how do I find the corresponding X. Realize this array will be much larger. The voltage and current values will come from either a read in file or a front panel control.
Probably the best way to do this is with a ring. Or, to do it programmatically, you could use a case structure, putting each multiplier, or offset function,or combination thereof, in a different case. In either instance, you'll have to do a fair bit of "wiring", but it should work nicely either way.
Eric
Eric P. Nichols P.O. Box 56235 North Pole, AK 99705
> Voltage > > 10 15 20 25 30 > 1 X X X X X > 2 X X X X X > Current 3 X X X X X > 4 X X X X X > 5 X X X X X > > > > So given I know the voltage and the current how do I find the > corresponding X. Realize this array will be much larger. The voltage > and current values will come from either a read in file or a front > panel control. >
First thing to do is map the current and voltage to indices into the table. If you know lots of info about the data in the table, you may be able to do simple mathematical operations. Otherwise, you will want to extract the first row and first column and store those with the table. Either do a Search 1D Array to find the exact column, or more likely, do a Threshold 1D Array. You will then have the indices nee ded to retrieve the value(s) from the table, and you can do any post processing to interpolate between multiple cells or whatever is appropriate. Anyway, the key is to get or keep the mapping values in 1D arrays.