shafin101 Posted January 14, 2015 Report Posted January 14, 2015 I am new in LabView and needed to create a sort of look up array. I have a pre-defined 4 column 11 row array. First column has the data for wavelength and the other 3 columns have other properties corresponding to the wavelength. I have to create a vi where I can feed in a wavelength value from 0 to 1000 and get the correct 3 properties from the table. The pre-defined array has discrete values of say 100, 200 and so forth but i want to allow users to type in any value in between and get a legitimate result. For instance if users feed 110 as wavelength, the output should be the properties for 100 wavelength. I tried to create using case structure but i end up creating 11 cases as you may find in the attached vi. If I need to add more elements later, this would be useless. Can you please show me any other way of doing it? Thanks! project_0.vi Quote
ShaunR Posted January 14, 2015 Report Posted January 14, 2015 Well. you have descrete increments that luckily correlate to the index. So if your user enters 110 you can just divide by 100 (quotient) and it will give you 1 which you can pass to the index array function to extract the row. The fun begins when you want to get to the closest higher or lower than the value input 1 Quote
shafin101 Posted January 14, 2015 Author Report Posted January 14, 2015 Many thanks LabVIEW Archetype... this(updated vi attached) is way better. I was also thinking of using interpolation for 'postion' and 'polarization'. However, cannot have interpolation for 'port' result as it has to be a fixed integer. Can I please pick your brain again? project_0_1.vi Quote
ShaunR Posted January 14, 2015 Report Posted January 14, 2015 There is a lot of information on interpolation in LabVIEW including examples which you can find using the Example Finder. 1 Quote
shafin101 Posted January 20, 2015 Author Report Posted January 20, 2015 (edited) thanks ShaunR... this is my updated vi. it does the job, however would appreciate more suggestions! project_2.vi Edited January 20, 2015 by shafin101 Quote
ShaunR Posted January 20, 2015 Report Posted January 20, 2015 thanks ShaunR... this is my updated vi. it does the job, however would appreciate more suggestions! Well. If it works, then it's probably enough. I'm a fan of graphs and stuff. What would be nice is if you graphed the points and either showed or allowed the user to select, with a cursor, the points on that graph - that's just me, though. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.