LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem: Real-time graphs vs show all points

Solved!
Go to solution

Hello guys,

I didn't really know how to simply describe the problem, so I'm sorry if the title is not the most adequate. Here is my problem:

I have a VI that every minute reads some csv's and outputs the data to some graphs. This was implemented using a simple while cycle. What I want to implement now is a way to show the last 100 points of my csv.

What happens is that everytime a minute pass, the graph is refreshed with the same last 100 points read. For example: On my first iteration it shows the 100 last points, but on the next it shows 200 points being 100 points repeated from the last interation and so on...What it is doing now is just adding 100 points to the data already present on the graph whereas I only want it to show the LAST 100 points and nothing more.

How do I solve this problem?

Maethis_0-1576601659494.png

0 Kudos
Message 1 of 4
(2,410 Views)
Solution
Accepted by Maethis

For a better answer, post your actual VI so we can see the code.

 

However, my first guess is that you're probably using a CHART, not a GRAPH.  Charts take 1 point as input and just perpetually append it to the end.  Graphs get passed an array of points and then display them.  If you switch to a graph, it'll only show the most recent data.  If you want to use it as a chart, you have to use property nodes or invoke nodes to reset the history data.

Message 2 of 4
(2,395 Views)
Solution
Accepted by Maethis

[EDIT: Oops, got interrupted as I started to type and got back to it too late.]

 

It sounds like you dropped down a waveform *chart* when you actually want the behavior of a waveform *graph*.  A chart is like a strip chart, and the contents will *accumulate* if you write to it multiple times (at least until you fill its buffer anyway -- set this by right-clicking and choosing "Chart History Length").  A graph's contents will be *replaced* if you write to it multiple times.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 3 of 4
(2,388 Views)

It does seem that the solution was simpler than I thought :P!

Thanks guys, what a rookie mistake!

0 Kudos
Message 4 of 4
(2,379 Views)