LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add elelment by element in an array of cluster

Hi All,

 

I have a problem in extracting data from array of cluster to a single cluster. Please have a look at the attachment.I have found the solution but it consumes lot of memory because of shif registers andi am using this many places which is loading to nearly 100% in RT. Please provide an better alternative solution.

 

 

0 Kudos
Message 1 of 20
(4,066 Views)

Try Index Array. 😉

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 20
(4,057 Views)

I cant use index array because i cant predetermine how many active array elements in cluster. After indexing them i have to unbundle each cluster and build it again!!!!!!Very complex. I need a generic solutionSmiley Sad

0 Kudos
Message 3 of 20
(4,053 Views)

Hi Geeta,

 

"i am using this many places"

When you do this operation very often, then why don't you store the data in the correct format?

The conversion from cluster of arrays to array of clusters is much easier (using BuildClusterArray)!

 

@Yamaeda:

How should an IndexArray help here? Geeta wants to convert an array of clusters to a cluster of arrays containing all values...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 20
(4,052 Views)

Hi,

 

No i am almost at the end of coding . If i change the entire architecture affects. Only problem is this logic consumes more time. Pls any other idea...

0 Kudos
Message 5 of 20
(4,047 Views)

What's wrong with plain auto indexing?

18431i70D3188621820610

That should give exactly the output you need.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 6 of 20
(4,041 Views)

Hi Ton,

 

Geeta uses a cluster of arrays. Indeed autoindexing would work, but then you need an additional ReshapeArray afterwards...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 20
(4,031 Views)

@Ton: This logic would give me the same output as input. No Change!!!

0 Kudos
Message 8 of 20
(4,027 Views)

Hi Geeta,

 

you can use Tons suggestion as a starting point. It forms your array of clusters into a cluster of array as you wanted.

 

You only have to add a ReshapeArray for each array to reshape from 2D to 1D after autoindexing!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 20
(4,009 Views)

 


@AutoTEC wrote:

Hi,

 

No i am almost at the end of coding . If i change the entire architecture affects. Only problem is this logic consumes more time. Pls any other idea...


 

Standard situation if a propper data management is not done before coding OR  lead to the wrong architekture.

 

Do you use type definitions? Help a lot to avoid the horror of optimizing the datastructure.

 

Since it is much faster to rebuild a cluster by indexing the elements from your cluster of arrays than generating a cluster  of arrays from an array of cluster (Puh!) 

AND you have timing problems I see only two solutions : Faster hardware or a reorganisation of your data.

So change the datasturcture , create a subvi 'IndexMyData2Cluster' and whereever you indexed the array of cluster  replace it with that vi.

 

Or run both structures in parrallel (BRRR, race conditions, inconsistent data , uuuaaahhh)


 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 10 of 20
(3,979 Views)