LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Workaround for displaying a very long period of time in a chart.

In a data acquisition program I wrote, the users aren't satisfied with how much data can be displayed in a chart. The program handles up to 32 channels in 2 stacked waveform charts. What I originally did was to just create one long waveform, cutting off the end and adding data to the beginning once a second when it got to be the desired length. This was incredibly slow and caused many problems. Now I'm just sending data directly to the charts, but the limitation is the chart history length.
 
I understand that I can't change this value while the VI is running because it allocates all the memory it will need to store the data for the chart. What I would like is a chart that displays data without saving the actual data to memory. It would just plot a point and remember what the graph looks like as a simple graphic. I also understand that I could go through the trouble of using a picture control and drawing/updating a graph myself, but this just seems like unnecessary effort, as I would have to account for how many channels to display and how to stack the plots, etc.
 
The users run 96 hour tests on multiple test units and want a printout of the graph over the entire time period. Any ideas?
0 Kudos
Message 1 of 25
(4,758 Views)
I had a similar problem with this when recording light data with a Photodiode Receiver Module set up.  I would run the test over a 168 hour period logging data and time at 3600000 milisecond intervals.  The VI would start out at around 30000 bytes but would have substantial memory leaks and would climb to double or triple that value in just one day. 
Is the data a XY scatter plot or an XY line plot?  Maybe changing the Chart History Length or add an X-scroll bar so you can track back and see previous data points.
Message 2 of 25
(4,750 Views)
Right, you're taking data once every hour. The requirement for my program is 50 times a second or more. I can change the chart history length, but if I make it extremely long, it allocates hundreds of MB of memory before the VI can even run. I understand this functionality and have no problem with it. I want a chart that can display and hold an image of data without actually buffering the data.
 
Try explaining this behavior to the users who just want it to work perfectly...
0 Kudos
Message 3 of 25
(4,746 Views)

Do you need to be able to see all the data?  It sounds to me like you just need the last X number of points, so I am curious why an array of that length that you fill and then use an actual graph doesn't work.

You said you tried something similiar but it is really slow, can you attach that code, maybe there is something we can fix in it to make it fast.  In addition what is "slow" and how fast would you like it.

0 Kudos
Message 4 of 25
(4,739 Views)
Would it be acceptable to view the entire graph only when the test is done? If it is, then you can save the data to file/database as it's acquired and have the user click a button 'View entire test' that then loads the entire test run from file and displays it on a graph.
0 Kudos
Message 5 of 25
(4,735 Views)
I see what you're saying. 
Luckily for me I get to control the entirety of my process and just have to report the results to whomever requested them.
 
Could you attach your code, perhaps I/we can get a better handle of this by actually seeing what you have going on.
0 Kudos
Message 6 of 25
(4,731 Views)

1. Yes, I need to be able to see all the data, not just the last X number of points.

2. They would like to be able to view the data as it's running as a strip chart to make sure the units are outputting the correct values.

3. That code that chopped a second off the beginning of the waveform and added a new second to the end was ridiculous. I don't want to even revisit it. All I really did was take a waveform subset of everything but the first second and then append the new second of data to the end, but it loaded the cpu to 100%. I don't use it anymore so it isn't the problem.

I found something in the picture controls that draws waveforms on graphs, so I'm going to play around with this. It's ideally what I want, I'll just update a picture control and the data won't have to be buffered in memory. I'm sure I'll run into another problem, but so far it looks like what I want.

0 Kudos
Message 7 of 25
(4,712 Views)
Ok, after playing with this I realize that I will have to keep one long running waveform for it to work, so that Idea is out.
 
So has anyone else ever had to display a strip chart of a very long dataset without saving all the data? There has to be some way of doing it.
0 Kudos
Message 8 of 25
(4,700 Views)
You said the requirement for your program is 50 times a second or more. 
 
Does this mean you are taking 50 samples per second? 
Could you be taking a certain # of samples for each of the 50 times per second(which could end up being a very very high number)?
 
I know through my data acquisition vi my clock settings are programmed to take 1000 samples at 1000 Hz for each point of data I log.
0 Kudos
Message 9 of 25
(4,683 Views)
My scan rate is 50 Hz. It's set up for continuous samples, the number of samples is used to determine the buffer size. I think you have a misconception of how that works. If your scan rate is 1000 Hz, and number of samples is 1000, that doesn't mean that your taking 1 million readings in a second. It means you're reading 1 second worth of data. If you also use continuous samples, then it will read until you stop it, but it's only reading at 1000 Hz.
Message 10 of 25
(4,676 Views)