06-05-2009 10:49 AM
Taking that example and placing the TDMS_AppendDataValues inside the DAQmx read loop worked just fine for me. Are you able to get this example to function correctly?
int CVICALLBACK StartCallback(...)
{
...
TDMSFileHandle file = 0;
TDMSChannelGroupHandle group;
TDMSChannelHandle* channels;
channels = malloc (sizeof(TDMSChannelHandle) * 1);
...
...
while( gRunning ) {
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,sampsPerChan,10.0,DAQmx_Val_GroupByScanNumber,data,sampsPerChan*numChannels,&numRead,NULL));
printf ("%f\n", *data);
TDMS_AppendDataValues (channels[0], data, 20, 1);
if( numRead>0 )
PlotStripChart(panel,PANEL_STRIPCHART,data,numRead*numChannels,0,0,VAL_DOUBLE);
ProcessSystemEvents();
}
}
...
}
Regards,
Steven Zittrower
Applications Engineer
National Instruments
06-05-2009 01:36 PM
06-05-2009 01:45 PM