Ni.com is currently experiencing issues that may cause some pages to fail.
Support teams are actively working on the resolution.
Ni.com is currently experiencing issues that may cause some pages to fail.
Support teams are actively working on the resolution.
06-13-2022 08:44 AM
Hi,
I have with help of other members here on the forum created a matrix and gridlines for a 3D lookup table where I am using the 3D LU table component from the control & simulation palette.
The whole idea is that the gridlines for the x, y & z axis and the output values (w) are read from in total 4 different CSV files. Then the user just writes the inputs manually
The implementation works good and the Vi runs without errors.
The problem is that it gives wrong output values and I really do not know why. I have sorted all input values for the 3D LU block according to how it is instructed in the documentation. The output values that i recieve do exists in my CSV file and the LU table though, but it is for completely different input values
Another thing which is worth mention that I also created a 2D LU table, there it works perfectly fine, I got exactly the outputs that I want.
Do anyone see any obvious errors in my VI for the 3D LU table or how I have sorted the input values for the 3D LU block?
I have attached all related CSV files and the VI for the 3D Lu table and the 2D LU table in the attached zip-file
06-13-2022 09:23 AM - edited 06-13-2022 09:25 AM
It probably would have helped to keep the discussion all in one place.
Since I don't have the simulation module, I cannot see what's there. Do you get the correct values when using regular primitives as shown eariler?
You still have way too much code! I thought you are aware the "index array" is resizeable, right?
06-13-2022 09:57 AM
Why I created a new thread was because if I specify that it is related to the simulation module 🙂
Here is how my block looks like in the simulation loop
And yes, when i arrange my inputs like this:
It works perfectly fine, i get the output that I want which is making me even more confused.
The reason I want the 3D LU table to work from the simulation module is that I want to have an interpolation between some the values, and interpolation is included in that block 🙂
06-13-2022 10:12 AM - edited 06-13-2022 10:14 AM
Sorry, I cannot test, but I would verify that the XYZ corresponds the the correct order of dimensions of the 3D array indices. Maybe you need to swap the X and Z arrays, for example. Check the help here.
You say that the values are wrong. How wrong? Can you guess? Can you test with some trivial sample data (e.g. a 2x2x2 LUT with all different values and arrays [0,1] for the xyz arrays). Should be easy to troubleshoot.
06-15-2022 08:59 AM
I have been trying with a trivial example (2 x 2 x 2) But when I add a page to the array (3 x 2 x 2) then all of a sudden I got this error message:
Even though I have added a index to the LUT Z array, see this figure:
And if it is of interest, here is how the array looks like, now with three pages:
Page 1:
Page 2:
Page 3:
So If I have interpreted what is being instructed in the documentation, which I think I have been doing, this error should not occur. So I really don not know why I got that error message actually...
06-15-2022 09:23 AM
I guess you simply need to know how [x,y,z] corresponds to [row, column, page] of the 3D array. Have you tried any other permutation?
06-17-2022 03:08 AM - edited 06-17-2022 03:20 AM
So I spend the day yesterday trying to figure out how the 3D Lu table VI is working.
I strongly suspect the documentation which can be seen here is incorrect.
I will show one example which consists of two pages that I have written by hand.
The first example shows how I want the LU array to be constructed with its corresponding index values for the pages ( LUT Z), rows (LUT X) and columns (LUT Y), in order t make in to make it easy for myself I just set the index values to 0, 1, 2 etc...
The other page which will be attached below illustrates how the array should be constructed in Labview in order to navigate in the table with the index values of x, y, z. For example if I want 21 from the LUT i set x to 2, y to 0 and z to 1.
This is very confusing and I really don not see any pattern on how LabVIEW interprets the data array.
A much easier way would of course be to have the data array in the LU table according to how it is formatted how I want it to be (page 1) and just change the interpretation of the x,y and z coordinates but for that I have not figure out how to do that, I don't even think it is possible actually.
I would really appreciate if someone could point out how the permutation works for the 3D LU table
06-17-2022 07:17 AM
Now I am really just speculating but could the problem be that the LUT data is a 3D array, whilst the LUT wants a 3D matrix?
06-17-2022 07:54 AM
@antje668 wrote:
Now I am really just speculating but could the problem be that the LUT data is a 3D array, whilst the LUT wants a 3D matrix?
The only "matrix" datatype in LabVIEW is a just glorified 2D array that is typedef'd to trigger certain linear algebra operations.
There is no 3D matrix datatype and even if there was, it would be identical to a 3D array.
Did you really try all possible permutations?
06-17-2022 08:33 AM
Alright I understand.
Yes I have tried all 6 possible combinations of x, y, z and the output from the LUT is not what i expect it to be.