LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array of (T0, Y1, Y2, Y3) clusters (with Blanks) to Graph

Solved!
Go to solution

I have an array of clusters each cluster has a timestamp (Xn) and an array of dbls (Yn,1; Yn,2;Yn,w...)


How can I change this arrangement into W clusters of Graphs with (Xn,Yn) arrays while not adding 0's to empty arrays:

Example:

MakeGraph.PNG

Fortunatly, it can be assumed that the first value in the array will always go to the first graph, the second to the second ect.

0 Kudos
Message 1 of 5
(3,009 Views)

Update:

Got it! However, it's a bit slow. Can anyone think of a better way?

makegraphSn.png

0 Kudos
Message 2 of 5
(2,985 Views)

Hi ATE,

 

why do people always use this "Insert into Array" function when all they want to achieve is to append elements to an array? Why not use BuildArray instead?

This way you can eliminate the ArraySize function and the comparison before the case structure…

 

You can also determine the largest array size in your input data. Use this information to initialize the output array with the correct number of "plots"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(2,980 Views)

@GerdW wrote:

Hi ATE,

 

why do people always use this "Insert into Array" function when all they want to achieve is to append elements to an array? Why not use BuildArray instead?

This way you can eliminate the ArraySize function and the comparison before the case structure…

 

You can also determine the largest array size in your input data. Use this information to initialize the output array with the correct number of "plots"…


Hey Gerd,

I do use BuildArray to add the X and Y values, into "plot N." After that, I'm using the "Replace element in array" to override the previous array state.

Also, How would I go about determining the largest size in the input data? 

0 Kudos
Message 4 of 5
(2,970 Views)
Solution
Accepted by ATE-EGNE

See if this works for you. No guarantees.. 😄

 

Seems to give the same result.... (but please test on other data)

 

Note: since the inner array cannot be larger than the outer input array, you could just use that, eliminating the first loop.

 

ProcessData.png

Message 5 of 5
(2,965 Views)