05-27-2025 04:05 AM
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!
05-27-2025 04:13 AM
One option is to use 'Decimate 1D Array'.
https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/decimate-1d-array.html
05-27-2025 09:20 AM
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!
05-28-2025 05:02 AM
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.
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.
05-28-2025 05:48 AM
@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.
05-28-2025 08:55 AM