Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

CNiGraph with large data

Hi everyone,
I have this issue:
Language: C++ (MFC) on Visual Studio.Net 2003 environment
         and Measurement Studio 8.0.1 (trial version)

I intend to switch from LabWindows/CVI to Measurement Studio
Please help me with 2 following questions:

Question 1:
   I have this piece of codes:
   CNiGraph m_Graph;

   for (i = 1; i <= 5000; i++)
      m_Graph.Plots.Add();

   for (i = 1; i <= 5000; i++)
      CNiInt32Vector vectorY(900);

      ...//prepare data for vectorY

      m_Graph.Plots.Item(i).ChartY(vectorY);

   and the program crashes for having too many data.

   However, in LabWindows/CVI, this piece of codes work fine:
   for (i = 1; i <= 5000; i++)
      //PlotXY: built-in function of LabWindows/CVI
      graph_handle = PlotXY (panelHandle, controlID, *xArray, *yArray
                             , 900 /*number of points*/,...)
      ListHandle.Add(graph_handle)

   So how can I make it works in Measurement Studio?

Question 2: How can I undo the zoom of a CNiGraph?

Regards,
0 Kudos
Message 1 of 2
(6,950 Views)
Hi Nhan123,

I setup a simple test on my machine to graph the same amount of data using VC++ MFC in Visual Studio 2003 with Measurement Studio and I was unable to reproduce this error.  I did not plot 5000 sets of 900 points however, as this would have taken a very very long time on my machine.  I was able to plot about 2000 sets of 900 points without any errors.  What was the exact error message that you are receiving when plotting this amount of data in Measurement Studio?

As for your second question, if have outlined a simple method to zoom back out to the default levels programmatically. I found this information in the Measurement Studio help by searching for CNiGraph.  The results returned a help topic titled "Using the Measurement Studio Graph Visual C++ Control".  In this help topic, there is a sub-topic titled "Panning and Zooming in the Measurement Studio Graph Visual C++ Control", which included the following example code that will reset the pan / zoom of a CNiGraph.

        m_graph.Axes.Item(1).SetMinMax(0, 10);
        m_graph.Axes.Item(2).SetMinMax(0, 10);

0 Kudos
Message 2 of 2
(6,900 Views)