To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI illustrates how to perform a lookup from a table of data saved in a spreadsheet file.
Description
Many applications rely on making a lookup to a table to extract pertinent data. Such tables are commonly saved in spreadsheets and have .CSV or .XLS (Excel) file extensions. This VI uses data composed of 3 different parameters, located in a .CSV file. The user can perform a lookup with 1 or 2 parameters. The goal of this VI is to illustrate the key components of a lookup system, such that more complex lookups can be derived from learning from this VI.
A few key things to note about this lookup program:
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Thanks for uploading these useful files. I downloaded them and my excitement built up as I started to open up LUT.vi only to suffer bitter disappointment when I couldn't open it because it was in LV 2010. Any chance you could upload additional copies in 2009 or earlier version.
Thank You
Hi Yin,
I have attached another ZIP file named LUT_80.zip which contains all the VIs in LabVIEW 8.0. Let me know if you still aren't able to access the code.
thanks for the upload Sanjay !
Yin
I have found a bug:
In the orignal LUT file there are multiple entries with 20 at param3. If in the lookup cluster I select param3 only and type 20 then all of them are listed. If modify the LUT file to create entries where param2 AND param3 are also the same (like A 0 1, B 0 1) then the following happens:
1. if I select only param2 (0) >>> all entries where param2 = 0 are listed
2. if I select only param3 (1) >>> all entries where param3 = 1 are listed
3. if I select both param2 (0) and param3 (1) then the Result is empty
I have not spent time to debug the code, but however this is a severe problem I guess probably it would be an easy fix.
I have created another version. I have no clue how to attach a file, so I attach a screenshot.
1. I have found better if we handle all the params as strings since the file read converts everything to string anyways
2. From my perspective if none of checkboxes are checked then the result should be equal to the LUT. This can be disputed of course, but if you want that feature just add an extra case around the for structure
3. The false case just drives the shift register of the for structure to the output tunnel
If you create the params and the checkboxes as arrays then this is a really scalable solution. (I hope its bug free)
There was a mis-wiring that prevented LUT.vi from finding table entries when only parameters 2 and 3 were selected for use. The inner most case structure in step 3 was wired to the arrays associated with parameters 1 and 3 instead of parameters 2 and 3.