# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## How to graph array elements with waveform chart?

Hi all,

I just began learning Labview, with not much programming experience aside from a course in MATLAB, so i apologize if my question does not sense\not enough detail

There is something i am trying to do:

I have a 1D array with 1001 indexes, and i am now trying to find a way to output (or plot on a graph) each of those indexes (starting at index 0) sequentially.

I attached an image of what i tried to do based on what i could learn from some google searches and youtube videos, but my graph does not appear correct - it seems to spike up and down between timesteps

thanks!!

Message 1 of 5
(2,833 Views)

## Re: How to graph array elements with waveform chart?

You are doing way too much work. A chart already contains a history buffer, so there is no need to build an array.

All you need is a single FOR loop. place the chart terminal inside the loop and wire the array across the loop boundary, so it is autoindexing. Place a reasonable wait inside the loop and press run. That's it! (The FOR loop will stop once the array runs out of elements. No need to wire N).

See how far you get. 😄

Message 2 of 5
(2,812 Views)

## Re: How to graph array elements with waveform chart?

Here's what I had in mind.

Message 3 of 5
(2,807 Views)
Solution
Accepted by topic author bkcw95

## Re: How to graph array elements with waveform chart?

• There is a +1 primitive.
• You get the same incrementing integer by wiring from the iteration terminal.
• Watch your representation. Use appropriate datatypes, for example the index should be blue. (see the red coercion dot and the index?).
• Again, autindexing is the correct way. Now you don't even need to wire N.
• You can show the digital display of the chart. No need for the "element" indicator.
• If you build the array in a shift register as you did, you would use a graph, not a chart. Make sure you know the difference!

Message 4 of 5
(2,792 Views)

## Re: How to graph array elements with waveform chart?

Thank you altenbach!!

Message 5 of 5
(2,784 Views)