Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

A question about CWGraph

I'm trying to use CWGraph ActiveX in my MFC project.

I'm using the CWGraph demo bundled with NI-DAQmx 7.5
and my VC++ is still the version 6.

I want to plot a slow varying signal (temperature)
so I was thinking to use a VC++ timer and update the plot
every two seconds.

Was wondering how I can pass the float64 value
(got from DAQmxReadAnalogScalarF64)to CWGraph.

I looked at "Getting started" PDF but I did't understand
(seems that I have to pase an array instead of a scalar).

Thanks in advance.
0 Kudos
Message 1 of 3
(3,830 Views)

If you look in your ...\National Instruments\Measurement Studio\VC\Examples\UI\Graph  folder, you can find examples that show how to work with the CNiGraph class.

AlessioD

0 Kudos
Message 2 of 3
(3,756 Views)
Transform float64 to double, then user SafeArrayCreate create a safearray, and pass the pointer of safearray to a _variant_t.
pass the _variant_t to CWGraph->Plots->Item(1L)->PlotXY(or PlotX, or PlotXvsY)...
0 Kudos
Message 3 of 3
(3,746 Views)