LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple plot in cwgraph

I'm using the CWGraph ActiveX control in LabWindows/CVI 6.0 (win98). Is it possible to plot multiple signals in 1 CWGraph? If that's possible, how can I do this, and how can I define an offset so the signals are getting seperated in the CWGraph?
0 Kudos
Message 1 of 2
(2,857 Views)
Yes, you would just create multiple plot objects (from the Plots collection of the graph or from the property pages). Then call the plotting function on each plot object. The below code will plot 7 sine waves on a graph (the plot objects already were created in the property pages, you could use PlotsAdd function intstead of PlotsItem if they have not been created yet).

CWUIControlsLib__DCWGraphGetPlots (hCWGraph, NULL, &hPlots);
for(i=1;i<7;i++)
{
CWUIControlsLib_CWPlotsItem (hPlots, NULL, CA_VariantInt(i),
&hCurrentPlot);
SineWave (140, 2.0, 1.0/110.0, &phase, wave);
CA_VariantSet1DArray (&vWave, CAVT_DOUBLE, 140, wave);
CWUIControlsLib_CWPlotChartY (hCurrentPlot, NULL, vWave,
CA_DEFAULT_VAL);

CA_VariantClear (&vWave);
CA_DiscardObjHandle(hCurrentPlot);
}


Hope that helps,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 2
(2,857 Views)