LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

stripchart points per screen max=10k?

Dear Support,

Just wondering if there's any way to increase the maximum number of points per screen in the stripchart widget to 50k.  Currently, it seems to be limited to 10k.  I'd really like to use the sweep mode, but my data rate is 50k - forcing me to abandon stripchart and resort to using the graph widget instead.

Regards,
Carl

0 Kudos
Message 1 of 5
(3,845 Views)
Hi Carl.

If you want to stick with the stripchart and you are sampling well above the Nyquist rate, you could use PlotStripChart() with the "Skip Count" parameter set to (4 * nChannels). This will limit the points per trace to 10k per second (assuming a 50k data rate).

Regards,
Colin.
0 Kudos
Message 2 of 5
(3,828 Views)
Agreed.

Still, I'm just wondering if the 10k limit on the stripchart can be increased to 50k or so - unless perhaps there is some physical limit that I'm not aware of.

I'm guessing that some of the spikes in my data could be just a few samples wide.

Cheers,
Carl

0 Kudos
Message 3 of 5
(3,822 Views)
Carl,

It seems that for now you need to go with the graph control, which can be made to behave somewhat like a strip chart. Here is a thread that may give you some useful ideas (check both pages).

Regards,
Colin.
0 Kudos
Message 4 of 5
(3,804 Views)

Carl:

In my opinion you really would be better off trying to reduce the amount of data you are trying to plot. The screen doesn't have the resolution, so why give the plotting function so much work to do? (Ok, I know it's the easy option)

If simply omitting points won't work for you, you could try what I normally do, which is to just plot the maximum and minimum values over a range of samples.

e.g. if you have an array of 50000 points

double inData[50000];

of the data you want to plot, then you could reduce this to (say) 10000 samples in a second array:

double plotData[10000];

using the following algorithm (there are all sorts of things you can do to speed this up, I've kept it simple):

int indx, kndx;

for (indx=kndx=0;indx<50000;indx+=10)
{
    int jndx;
    double maxVal = inData[indx];
    double minVal = maxVal;

    for (jndx=1;jndx<10;jndx++) // Note get maximum and minimum vals, so 10 points reduces to 2 points
    {
        if (inData[indx+jndx]<minVal)
            minVal = inData[indx+jndx];
        else if (inData[indx+jndx]>maxVal)
            maxVal = inData[indx+jndx];
    }

    plotData[kndx++] = minVal;
    plotData[kndx++] = maxVal;
}

Whilst this takes some processing, the plot routines won't have to do all that scaling and line drawing, so you usually win in terms of execution speed.

--
Martin
Certified CVI Developer
0 Kudos
Message 5 of 5
(3,793 Views)