07-13-2005 10:34 AM
07-13-2005 11:55 AM
If you are going to create an application using C++, .NET Windows Forms, and Measurement Studio, you have two choices to plot a 1D array of floats:
Here is an example of using AxCWGraph.PlotXY:
float values __gc[] = { 1.0, 2.0, 1.0, 2.0, 1.0 } ;
axCWGraph1->PlotY(values);
Here is an equivalent example using WaveformGraph.PlotY:
float values __gc[] = { 1.0, 2.0, 1.0, 2.0, 1.0 } ;
double convertedValues __gc[] = (double __gc[])DataConverter::Convert(values, __typeof(double __gc[]));
waveformGraph1->PlotY(convertedValues);
Hope this helps.
- Elton
07-13-2005 12:50 PM
07-13-2005 12:59 PM
Yes, that will work. If you want to use the native Measurement Studio .NET UI Windows Forms control, you can use ScatterGraph.PlotXY. Just out of curiosity, is there a reason that you are using an interop wrapper for the CWGraph control rather than using the native Measurement Studio .NET Windows Forms controls?
- Elton
07-28-2005 01:53 PM
Hi Elton,
I hope you can read this again. How would I access Scattergraph controls in Visual C++.net?
I current have Measurement Studios 7.0 and only have AxCWGraph class when I create the graph UI.
I do want to use the PlotXY method, but the prototype for it is PlotXY(Object * __gc, Object* __gc)
I am assuming Scattergraph is PlotXY(double x, double y), which I want to use.
Thanks alot!
07-28-2005 01:57 PM
ScatterGraph has PlotXY(double x, double y) and PlotXY(double[], double[]). Did you install the Measurement Studio .NET libraries when you installed Measurement Studio? If so, when you open the Windows Forms designer in a Managed C++ project, look at the toolbox and you should see a tab for the Measurement Studio .NET controls. Open this tab and you will see ScatterGraph, and then you can drag and drop a ScatterGraph to the form.
- Elton
07-28-2005 02:03 PM
07-28-2005 02:07 PM
There are two toolbox tabs: one for Measurement Studio C++ controls and another for Measurement Studio .NET controls. The Measurement Studio C++ tab has CWGraph, CWSlide, etc. The Measurement Studio .NET tab has ScatterGraph, WaveformGraph, etc. If you do not see the Measurement Studio .NET tab, then you probably do not have the Measurement Studio .NET libraries installed. You can double-check your Measurement Studio installation directory to be sure. If the Measurement Studio .NET libraries are installed and the toolbox tab is not appearing, you can create the toolbox tab yourself and add the controls from the NationalInstruments.UI.WindowsForms.dll assembly in the Measurement Studio installation directory.
- Elton
08-09-2005 05:01 PM
08-09-2005 05:06 PM
Nevermind, I found out what was wrong. Did not look close enough to find the scatter graph object. Sorry to bother you! thanks!