LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a big array with just a few numbers in it?

Solved!
Go to solution

Deal All

I would appreciate alot if you can help me with this problem.

I want to Highlight some points on a diagram which its horizontal size is 1000. so I create another array with the same size of the main diagram which contains my desired points then I have to put other free slots as ZERO!!! which is not suitable at all.

so I am thinking of an array of a size of 1000 but with just a few numbers in it but I think its not possible.

please tell me if there is any other soloution.

many many thanks

I will mark the best answers for sure

Ali

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

Hi Ali,

you can initialize your array with size 1000 and your default value (use initialize Array function). After this you can use a for loop with replace array subset in it. Change the tunnels to shift register. Connect your position array and your new value array with autoindexing to this loop (both arrays should have the same size).

 

Mike

Message 2 of 5
(3,089 Views)
I think you have to use a table and convert your data strings. This because you do not have the equivalent of empty strings then it comes to numbers


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 5
(3,085 Views)
Solution
Accepted by topic author Lili_M

Hello Ali,

As I understood, you want to mark orhighlight some certain points in a waveform Graph. A simple way to do this is to use annotations (e.g. without the arrows, just dots), there are examples shipped with LV. Another way is to use an XY- Graph. There you can put certain points at certain X- positions. 

Maybe that helps,

greets, dave

Greets, Dave
Message 4 of 5
(3,084 Views)

Ali,

 

If you initialize an array with NaN (Not a Number), those values do not show up when plotted on a graph or chart.  Before annotations were available plotting a graph with a few points and mostly NaN was often done.

 

Another possibility would be to create an array of clusters.  Each cluster would have X and Y values, thus representing a single point.  The array of clusters of points would only need to contain data for the points of interest. For 1000 points it does not make too much difference, but if you had arrays of millions of points and only wanted to highlight data on a few points, the array of clusters would use much less memory.  Graphing millions of points never makes sense because LV and the OS reduces the data to the number of pixels in the line on the graph.

 

Lynn 

0 Kudos
Message 5 of 5
(3,046 Views)