LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Intensity chart slow drawing

Hello,
I have following problem I am writing program for OCT measurement. It consists of four Queued state machines.

the first one takes care about user interaction
the second one is for DAQ
the third one communicates with ESP 300
and the fourth one processes data acquired in DAQ loop and passed in other queue.

Usually we acquire aprox. each 100ms 8000samples but 2000 are cut off, so into processing goes only 6000 samples each time. This data after processing should be added into Intensity Chart that works as a sweep chart. The History length of this chart is set to 1001. I understood that when I write first captured and processed data into the chart it allocates memory for whole history and it allocates the memory as one continuous part of RAM. So it should mean 1001x6000 and because data are doubles that take 8bytes each the result should be aprox 45MB. Is that right?

So now everything goes OK when we send to this chart around 200 of these 1D arrays (6000samples each 100ms) When the 200th array is sent the x axis is flipped and history erased than is starts filling the chart again.

The problem is that when we send around 500 1D arrays we are in trouble. In the beginning it goes fine but after while acquired data cumulates in the data queue more the chart is filled. When the last point is reached and the history is cleared it starts to fill again fast but it cannot process all data in the queue and after some time it starts to cumulate the data again. And more data in queue slower the application goes.

Can somebody clarify me this behaviour? When the memory is allocated in the beginning why it slows when the chart is fuller? It little helps when I switch to another Tab in the application and I don’t see the tab (hmmm but I have to see what I measure) so I suppose the whole problem is in the data drawing. Is there any way how to improve this?

I also attach the application. The top vi is in TOP folder

Thanks for any help

Message Edited by ceties on 04-05-2007 04:44 AM

LV 2011, Win7
0 Kudos
Message 1 of 5
(3,291 Views)
Hmmm I went through many threads (that is what I should have done before posting my question) and I realized that my problem is that I fit too many samples into chart that has height cca 600pixels. So Labview has to do a lot of processing arround to downsample the data. So the solution would be to decimate the 1D array before it is added to the chart. Does somebody accomplish this task for Intensity chart?

Message Edited by ceties on 04-05-2007 10:54 AM

LV 2011, Win7
0 Kudos
Message 2 of 5
(3,278 Views)

Ceties,

Take a look at this VI, I have used it for "Typical" decimation. I created a test VI where I used this with data to an intensity chart.  Visually the chart with and without this seem to look the same to me.

Let me know if this helps, because there may be other areas to speed up the code.

Download All
Message 3 of 5
(3,266 Views)
Hello Evan and others,

Thanks for your help. I tested it little bit and it seems to work perfect. I will test it soon with large data sets so I will refer more afterwards but I believe this solved my problems.

I also add link that helped me. At the end is also library with examples that includes the same decimation method as Evan posted:
Managing Large Data Sets in LabVIEW

Thx a lot!
LV 2011, Win7
0 Kudos
Message 4 of 5
(3,236 Views)
Hello all,

one more thing. The algorithm seems to work fine. Only problem is if input array includes also NaN values (in my application as a result of 10 base logarithm - if input values are negative). After the original array is split into subarrays and in these subarrays Max and Min values are being found problem can occur when the subarray consist only of NaN values. Then the LabView "Array Max & Min" doesn't find any Max and Min and it will output zero(!) for these values and their indexes will be -1. Nevertheless in this case instead of zero NaN is better solution. Zero is nonsense - at least in my application.

Changed SubVi's of decimation attached
LV 2011, Win7
0 Kudos
Message 5 of 5
(3,206 Views)