Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

NI PCI 5153 Interfacing.

dear Friends

 

can anyone tell me how to read waveform data from NI PCI 5153 Data Acquisition card? I tried the following:

 

#include "niScope.h"
#include "niHWS.h"
#include "NIPCI.h"


int main(int argc, char* argv[])
{

    ViSession vi; ViSession* v;
    ViInt32 acquisitionType = NISCOPE_VAL_NORMAL;
    ViConstString channelList = "0", channel = "0";
    ViReal64 timeout = 0;
    ViInt32 numSamples, waveformSize = 1000;
    ViInt32* actualPoints;
    ViReal64* wfm, *xIncrement, *initialX;
    ViInt8* wfm8;
    ViReal64 waveform[2000];
    struct niScope_wfmInfo* wfmInfo;

    wfm = new ViReal64[2000];

    for( int i = 0; i < 2000; i++ )
    {
        wfm[i] = 100;
        waveform[i] = 200;
    }
ViInt32 actualRecordLength, numWfms;
ViRsrc resourceName = "DAQ::1"; ViBoolean IDQuery = VI_TRUE; ViBoolean resetDevice = VI_TRUE ;

niScope_init("Dev1", VI_FALSE, VI_TRUE, &vi);
niScope_InitiateAcquisition (vi);
niScope_Fetch(vi, channelList, timeout, numSamples, wfm, wfmInfo);

printf( "%f\n", wfm[10] );
printf( "%f\n", wfm[21] );
printf( "%f\n", wfm[42] );
printf( "%f\n", wfm[53] );
printf( "\n\n\n" );

}

 

It prints only 200.0, that means the array does not have any data.

 

How to retrieve data from NI PCI 5153??

 

Please

 

Bapi

0 Kudos
Message 1 of 1
(4,096 Views)