Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

CWAIReadSpec

I want to use the CreateCWAIReadSpec - Function from daqtools to get the acquired data from an AI activex -control to get special points out of the data like falling edge etc.
I use the following to do this:

m_daqtools1.CreateCWAIReadSpec(), but I`ll get always an error message then I do this.

What I`m doing wrong and how can I get the Voltage measurements out of the acquired data?

Thanks an merry X-mas and a happy new year to all

Stefan
0 Kudos
Message 1 of 2
(3,080 Views)
Hi Stefan,
What kind of errors are you getting? If I'm not mistaken the CWAIReadSpec can only provide you with the status of your acquisition, such as the ReadMark and the ScanBacklog. If what you need is to get the acutal data (the voltage measurements), then you might want to look at the AcquiredData event or the Progress event. The CWAI control fires any or both of these events when the user-specified number of samples has been reached. You can configure these events to be fired under the Buffer properties of the CWAI control.
The method signature of the AcquiredData event looks as follows:
void CContinuousAcquireDlg::OnAcquiredDataCwai1(VARIANT FAR* ScaledData, VARIANT FAR* BinaryCodes)
{
// Plot the data on the graph
COleVariant vOptional((long) DISP
_E_PARAMNOTFOUND, VT_ERROR);
m_CWGraph.PlotY(*ScaledData,vOptional,vOptional,vOptional);

}

where the ScaledData contains the voltage measurements.
If this is what you are trying to obtain, there are some examples on NI's website that show the complete DAQ operation.

Regards,

Azucena
National Instruments
0 Kudos
Message 2 of 2
(3,080 Views)