11-12-2017 11:24 PM
Hey guys first time poster I have been stuck at this point for a couple days now.
Im trying to take a 24 bits per row 2D boolean array sample i've reshaped from originally 8 bits per row, just repeated the 8 bits 3 times over to get 24 bits per row.
Now my problem is when I'm trying to convert this 24 bits per row 2D array into a single 2D array that consists of one 12 bit sample per row. It would generate this 12 bit sample from the 24 bits per row and would consist of the first 12 bits from the 24 bit per row 2D array in the first row and the 2nd row would have a particular assortment of the 24 bit row 2D array which I have indexed in my VI. And this combination would repeat.
Now really sure how to build the single 2D final array from my 24 bit per row array. And I know what the end result 2D boolean array should look like based on this initial sample and im not close. Need help at that point.
Ive attached my code to help explain but any help about my situation would be awesome!
Thanks.
Solved! Go to Solution.
11-13-2017 01:04 AM
@RichardTalbot wrote:
And I know what the end result 2D boolean array should look like based on this initial sample and im not close.
It would help if you also tell us how it should look like. It is not clear from the description.
11-13-2017 01:08 AM
The attached code does the same as your VI except the output is sized correctly.
In what way is the output wrong?
11-13-2017 01:14 AM - edited 11-13-2017 01:15 AM
Hi Richard,
Hey guys first time poster
Welcome!
For "first timers" I usually recommend the free online resources to learn LabVIEW…
Im trying to take a 24 bits per row 2D boolean array sample i've reshaped from originally 8 bits per row, just repeated the 8 bits 3 times over to get 24 bits per row.
Ok, that's what your VI is meant to do?
Why not use a loop like this:
(You might also get away without loop and/or excessive IndexArray/InsertIntoArray functions!)
Now my problem is when I'm trying to convert this 24 bits per row 2D array into a single 2D array that consists of one 12 bit sample per row. It would generate this 12 bit sample from the 24 bits per row and would consist of the first 12 bits from the 24 bit per row 2D array in the first row and the 2nd row would have a particular assortment of the 24 bit row 2D array which I have indexed in my VI. And this combination would repeat.
- In your VI you are indexing columns - but in your text you want to handle rows!?
- What is a "particular assortment of the 24 bit row 2D array" in the 2nd row?
- What should "repeat"?
General recommendation:
- NEVER insert into an empty array. Whenever you (think you) want to do this you should use BuildArray…
- Learn usage of loops, the autoindexing in loops and usage of shift registers in loops. This will help you handling arrays a lot!
11-13-2017 10:28 AM
Thanks for the quick replies everybody didnt realize it would happen so quickly!
The final product should look like what I have attached sorry I didnt attach it earlier.
I can get to the making of 24 bit rows part and your suggestions are much more effcient than mine I will implement a combination of what has been posted and not insert into array.
My problem is rearranging the 24 bit row array as you can see when comparing the initial and final product, I need to rearrange the 24 bit row accordingly and then change it to a 12 bit per row with the final product ive attached. The proper arrangement order is in my first code posted where I take all the index array subsets (0-11 for first 12 bits and 16-15 for second 12 bits).
Thanks again for the help Ill try again at it and might be able to get it myself
11-13-2017 10:53 AM
Hi GerdW,
The assortment to my understanding is of the columns, I essentially have to rearrange the index's of the columns in the 24 bit row and then change it to 12 bits per row for the final output. I posted the final product in my second post and the assortment as well.
Thanks for all the advice though!
11-13-2017 10:56 AM
@RichardTalbot wrote:
... and 16-15 for second 12 bits).
Can you explain that with an example?
11-13-2017 11:08 AM
For sure I can try.
So we have the initial input which is given and its in a 8 numbers per row format lets say 1-8 for the first row as an example.
What I think I need to do is change this row into 24 numbers per row format, which is a repeat of this initial sample 3 times over. Then the tricky part is that from these 24 numbers per row we want to extract a 2 samples of 12 numbers, the first sample being: 0,1,2,3,4,5,6,7,8,9,10,11 indexes of the 24 number row (first 12 numbers) and then second sample being: 16,17,18,19,20,21,22,23,12,13,14,15 indexes of the 24 number row (particular arranged index assortment based on what im trying to accomplish). Then from this I need to conclude in a 12 number per row array with one sample per row, following after one another. Ex. first row = first 12 numbers of 24 number row array, whereas second row = particular assortment of the last 12 numbers of 24 number row array.
That is what I think I need to do to produce the output array. Hopefully that helps
11-13-2017 11:29 AM
So, shouldn't the output have twice as many rows as the input?
11-13-2017 11:35 AM
Yeah, im not worried about the number of rows just the row length.