LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in segregating the data from array

Solved!
Go to solution

Dear all,

I am getting the data from different analog and digital channel and continuously storing it in the array. 

I want to segregate channel wise data. Please refer attached image.

First three are analog then rest two are boolean then repeat.

can I separate the yellow data in some register, where next value can overwrite the previous one.. and so on for rest of the data.

Please find attachment 

Thanks in advance 🙂

 

0 Kudos
Message 1 of 6
(2,699 Views)

Use Reshape Array to turn it into a 2D array so that each row contains a set of readings.  Then you can just use Index Array to get the column(s) you care about.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(2,673 Views)
Solution
Accepted by topic author suyash.barodiya

Decimate array, extended to a total of 5 elements, will have the yellow data in the first output and the red data in the second output.

 

I don't know if this is faster than reshape followed by index. Do a benchmark and let us know!

CLA - Kudos is how we show our appreciation for comments that helped us!
Message 3 of 6
(2,646 Views)

Hi suyash,

 

after going through some basic LabVIEW lessons you should be able to get to the very basic "index array elements in a loop approach":

check.png

(ReshapeArray and DecimateArray will also solve your problem, probably in a more optimized way. But still then you should understand the code you are writing…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(2,634 Views)

@MaxJoseph wrote:

Decimate array, extended to a total of 5 elements, will have the yellow data in the first output and the red data in the second output.

 

I don't know if this is faster than reshape followed by index. Do a benchmark and let us know!


From a scalability perspective, the reshape is better.  The Decimate 1D Array forces you to a set number of channels at compile time.  The Reshape Array allows me to define how many channels at runtime (more scalable).

 

However, if I had to guess I would say the Decimate 1D Array would likely be faster.  Need benchmarks to prove it.  I may be surprised.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 6
(2,627 Views)

Hello Every one,

Thank you very much for providing me the solution.

All the options are working but decimate array worked for me. I do not have waste knowledge of LabVIEW but in may case i have seen that option of reshaping array is faster than decimate array, but still we need some experts review on it.

Have a great day Smiley Happy

0 Kudos
Message 6 of 6
(2,593 Views)