LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

if i can read the data of strip char graf

Did i can read the data of strip char graf after i stop the plot of new data .
0 Kudos
Message 1 of 2
(2,890 Views)
I do not have an answer to your question. However I do know a work-around.

I would create a memory-buffer equal to the width of the stripchart e.g 600 pixels. I would copy new stripchart data to this buffer. When the data stream is halted, the last N data are still available in the buffer.

P.S. I typed this example below as I reply to this question. Don't be disturbed if there is compile error e.g. semi-colon missing or variable undeclared.

/* init variables */
#define CYCLICBUFNUMBER 400
double cyclicbuf[CYCLICBUFNUMBER];
int cyclicptr = -1;
int cyclicfull = 0;

/* fill cyclic buffer while plotting strip chart */
cyclicptr += 1;
if (cyclicptr >= CYCLICBUFNUMBER)
{
cyclicptr = 0;
cyclicfull = 1;
}
cyclicbuf[cyclicptr] = newdata;
PlotStripChartP
oint(panel, control, newdata)

/* recall data in correct sequence from buffer */
int firstdata = 0;
if (cyclicfull == 1) firstdata = cyclicptr + 1;
if (firstdata >= CYCLICBUFNUMBER) firstdata = 0;
while(firstdata != cyclicptr)
{
data = cyclicbuf[firstdata]
firstdata += 1;
if (firstdata >= CYCLICBUFNUMBER) firstdata = 0;
}
lastdata = cyclicbuf[cyclicptr];
0 Kudos
Message 2 of 2
(2,890 Views)