Jump to content

Look up array


Recommended Posts

Posted

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

Posted

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

  • Like 1
Posted

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

Posted

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.

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.