12-18-2024 12:33 PM
Hi Guys,
I have a 1D array with 100,000 row. I need to get data in the following order.
96 byte voltage and current
32 byte address data
96 byte voltage and current
32 byte address data
96 byte voltage and current
32 byte address data
until the end of the data in the 1D array.
I need to put each 96 byte data and 32 byte data in two specific 1D array that I have to process later.
I used a while loop but it does not give me correct result and I am not sure were to connect the resultant two output array.
Moreover the boolean selector pin in the attached VI should also be operated automatically depending on the count number of each 96 and 32 number
96+32+96+32.... and so on.
Solved! Go to Solution.
12-18-2024 01:14 PM
Hi Hk,
@Hk637 wrote:
I have a 1D array with 100,000 row.
A 1D array only has elements, it doesn't have rows or columns…
@Hk637 wrote:
I need to get data in the following order.
96 byte voltage and current
32 byte address data
So you will receive two 2D arrays, one with rows of "voltage and current" and the other with rows of "address data"…
12-18-2024 01:16 PM
Well for starters, the lower input on your "array subset" is wrong.
It's a "length" value, not a "end of selection" value. So you should be just using a constant 96 or 32 there, not i+96 or i+32.
Also, your input array is of type I16. That's two bytes for each. Did you maybe want that to be an I8 or U8, or are these actually two bytes?
This is what I would suggest, if I have understood your problem right:
12-19-2024 08:38 AM
Thanks.
I implemented but I guess the Vi only give one chunk of 96 and 32 byte set of data from the total 14,319 data set (Array Size (Size=1,832,962) / 128 = 14319)
How about the remanining data set ? Although the for loop iterate for 14319 times, it only gives me one chunk of 96 and 32 byte of data.
To include rest of the data set I try to use another "for loop" and case structure. But I am not sure how to include all 1,832,962 set of data into 96 and 32 byte data chunk one after another until there is no data left dynamically.
12-19-2024 08:52 AM
Thanks.
I implemented but the VI gives only one chunk of 96 and 32 set of data out of 14,319 iteration.
Array size (1,832,962) / 128 = 14,319. I need to get all the data in 96 set then 32 set serially until there is no data left.
I tried the following but not sure how to get the array with all 96 chunk and 32 chunk from the remaining data set.
Thanks in advance for the reply.
12-19-2024 09:24 AM - edited 12-19-2024 09:26 AM
Hi hk,
@Hk637 wrote:
I implemented but the VI gives only one chunk of 96 and 32 set of data out of 14,319 iteration
Is it so hard to follow my suggestion?
To keep the "remaining bytes" you just need to use the remainder of the modulo function to know how many bytes will remain at the end of the input array…
12-19-2024 11:09 AM
@GerdW wrote:
Hi hk,
@Hk637 wrote:
I implemented but the VI gives only one chunk of 96 and 32 set of data out of 14,319 iteration
Is it so hard to follow my suggestion?
To keep the "remaining bytes" you just need to use the remainder of the modulo function to know how many bytes will remain at the end of the input array…
Since the OP apparently wants the output as two 1D arrays, this can be fixed my making the two output tunnels concatenating.
12-19-2024 11:29 AM
12-19-2024 11:32 AM
Can you please attach the VI?
Thanks in advance.
12-19-2024 01:10 PM
Sorry, it might be a smiple fix but actually I fear that I am not getting all the data from the 2D array into the 1D array in the following order
2D array
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
1D array = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
I tried to do the following but out of the total total number of data, I am getting only 1st 95 data properly and rest of them are zero:
I would really appreciate if someone point me in the right direction with possibly with example VI.