LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot every 2nd or 3rd value from a 1D array on a chart

Hi everyone,
I’d like to plot a 1D array on a chart.
However, I only want to display every 2nd or 3rd value, I still don't know.
Can someone help me figure out how to do this?

Thanks in advance!

0 Kudos
Message 1 of 6
(150 Views)
0 Kudos
Message 2 of 6
(147 Views)

You might confuse graphs and charts. Are you aware of the difference?

 

Charts:

Charts typically receive one point at a time and maintain a history, so place the chart terminal inside a case structure that is only active at regular intervals.

 

Things get more complicated if the chart receives multiple values at a time or if you want to display the x-axis in defined time units. You also need to decide what to do if you change the decimation during the run.

 

Graphs:

Graphs display whatever data is in the wire, so you need to decimate that data, and there are many ways to do that, especially if you want to be able change the decimation factor to any other value during the run.

 

In summary, show us you code so we can see what you have. What does "2nd or 3rd" even mean? When is the decision made between the two alternatives? Currently, your description is way too ambiguous!

0 Kudos
Message 3 of 6
(101 Views)

In my code, I'm continuously receiving data through a TCP read. Then, I display the data on a chart. However, I don't want the chart to display all the data.

Here is a screenshot of my VI, and I’ve also attached the file.

 

Ouinon_0-1748426541573.png

 

And maybe, as you said, Altenbach, I didn’t fully understand the difference between graphs and charts. In my chart, the x-axis represents time, but it seems to move too fast.

I formatted it to display time in the format HH:MM:SS (I assume that means hours, minutes, and seconds), but the "seconds" seem more like milliseconds.

 

0 Kudos
Message 4 of 6
(76 Views)

@Ouinon wrote:

And maybe, as you said, Altenbach, I didn’t fully understand the difference between graphs and charts. In my chart, the x-axis represents time, but it seems to move too fast.

I formatted it to display time in the format HH:MM:SS (I assume that means hours, minutes, and seconds), but the "seconds" seem more like milliseconds.

 


You're not showing "every 3rd data" you're only showing 1 channel. When you only wire the value like that the default scaling is simply 'samples'. If you know the speed you can change the properties of the graph so it counts the time correctly. Just change the Multiplier.

Yamaeda_0-1748429252976.png

 

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 6
(68 Views)
  • To only chart every 3rd point, you can do as follows (as already explained)
  • Charts accept scalars, no need to built it into an array with one element.

 

altenbach_0-1748440472300.png

 

0 Kudos
Message 6 of 6
(55 Views)