06-10-2022 09:26 AM
Sorry for that, I have now saved it as v16 file.
The problem is that my 3d Matrix (named array in the VI) only seem to take in the first value while all other values only are NaNs.
06-10-2022 09:29 AM
Either save 1 CSV for each Z, or use Rehape array to a 1D to write it to one file (and add some info about dimension sizes)
06-10-2022 09:46 AM
@antje668 wrote:
Sorry for that, I have now saved it as v16 file.
The problem is that my 3d Matrix (named array in the VI) only seem to take in the first value while all other values only are NaNs.
The problem is the autoindexing messing up the grid. It needs to be a single 1D array to work. In the current way you organized your files, it should work like so:
You can use "Highlight Execution" to see the program in action, so you can trace where the data is flowing and "Auto-Clean up Block Diagram" should work great on your VI to shorten the paths.
06-10-2022 09:57 AM
Since your gridlines are 1D, you should read them as 1D (and transposed) and not autoindex.
(Search array, is generally dangerous for DBLs. Since these are non-descending, I would use threshold array and round to nearest. It is also more efficient)
06-10-2022 10:27 AM - edited 06-10-2022 10:44 AM
See if this can give you some ideas (probably needs some tweaks):
Notes:
06-10-2022 10:43 AM
@altenbach wrote:
See if this can give you some ideas [...]
It certainly gave me some. Bundling/Unbundling arrays to prevent the autoindex from resizing the smaller ones into a large 2D-Array is something I'll gladly add to my toolset.
06-10-2022 11:09 AM
Firstly thank for a very nice and neat code which suits my task great. I do have some questions about it though.
Could a solution be to just multiply the size of the three grids and have that as an input to "number of rows" in the read delimited spreadsheet VI?
- GridlinesZ has duplicate values!!! Make sure you use sufficient digits when writing it.c.
I Noticed that now, you made it clear with the size indicator 🙂
I seem to get what i want from your code, the 3D matrix (named Array) is strucutred as I want.
The next step for me would now to use the 3D lookup table block, and for that I think I might need to split the X,Y,Z inputs into three different vectors? The LUT Data input to the LU table is already there (The 3D matrix named Array) However I tried to do so and got this error message: "The dimensions of the arrays of the lookup table are inconsistent" which I really dont understand how they could be?
06-10-2022 11:11 AM - edited 06-10-2022 11:18 AM
When you get an error, show us your code. We are not clairvoyant!
(You can use exactly the same code as I did do turn value triplets into 3D indices, then use index array instead of replace array subset to get that element.)
Be aware that "threshold array" will give you the nearest even if there is no exact match. You might want to test if the result is close enough to an integer to be valid.
You still need to either increase the resolution of your Z scale or eliminate the duplicate value.
06-10-2022 11:56 AM
Sorry for that!
Here is how my code looks like right now, I could not clearly grasp how to split up the vectors in the way you proposed, the index array output is a double and the shift registers takes in a 3D array. Maybe I misunderstood how to get it working with the index array.
I have attached the code I have right now with the 3D lookup table Vi from the simulation and control palette. I have also attached the new gridline file for Z values, without duplicates.
06-10-2022 12:17 PM
Sorry, I don't have the simulation toolkit, but to look up a value using "index array", here's how you would do it.