LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY Graph saturation

Hi everyone,

 

I'm getting a X position over time and I want to plot the position during the acquisition (online). I use a shift register to keep in memory both time and position and then I use a the XY Graph. I have to display all the signals from the beginning to the end of the acquisition. Nevertheless, everything works the five first minutes and then there are increasing lags between the recorded position and the real position. It comes from the XY graph. How can I fix this problem?

I put a VI to show you an example with a sine over time.

 

Thanx for your help,

Andrew

0 Kudos
Message 1 of 6
(3,502 Views)

Let me guess: You are working with a LV 32 bit?

You are collecting buzzing 480MB per 5 minutes, doubling that with display. So within 5 minutes, you take ONE GIGABYTE of memory for your VI, rapidly increasing. When is the moment your application spawns the infamous "out of memory" error message??

 

Hint: Never build arrays indefinetly in size!

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 6
(3,499 Views)

Thanx for your answer. Yes, i'm working with LV 32 bits, but I don't have any error message. There are just lags between the recorded position and the actual position. If I use wafeworm chart, then there is no problem but the point is that I need to display all the signal from 0 to the end of the acquisition, that's why I use shift register and XY graph. How could I write a VI to fix this problem ?

 

0 Kudos
Message 3 of 6
(3,491 Views)

How long did you run the VI at all? I would expect the VI on 64bit Windows to run out of memory within 8-12 minutes......

 

Your problem is increasing demand in memory, hence required allocation of increasing sizes for the arrays.

Depending on your requirements, there are two things you can do:

a) Buy a new machine with 64bit LV and something like 32-64 GB RAM in order to reduce noticable slow down in the expected "time to run"

b) Incorporate sophisticated memory management including a limited amount of "history of movement"

 

Regarding b) a hint: Preallocate the arrays and use "replace array subset" to update position/time accordingly.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(3,482 Views)

Ok, thanx for your suggestions. That's very kind of you. It's weird that we can not plot the position over time without using a shift register. For example, it would have been great if at each iteration of the loop, the program plots a point with the current coordinates (time, position)  and keeps the other points on the graph (this is just visual, no need to keep the points in memory)

0 Kudos
Message 5 of 6
(3,471 Views)

Well, i believe that there is a misunderstanding now:

The shift register is an essential part for your application!

 

Point is that currently your data is growing unbounded which will eventually blow the computer resources (memory). The increasing slow-down is only a "symptom" which is connected to this issue.

 

There are, as usually in computer science, many different ways to approach this. The easiest is, however, to limit the amount of data in the first hand and either "reset" the data once that amount is reached or to keep "a circular buffer" which stores the last X seconds/minutes.....

 

The graph will only plot data you pass to it, so maybe you can reduce the data before plotting it as you will never paint something like 30,000 pixels in your graph to display all position/time-combinations you collect within 5 minutes.....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 6
(3,445 Views)