LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using TDMS to stream from continuous data acquisition

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

http://www.ni.com/support

 

Message 11 of 13
(1,306 Views)
I'm getting a message saying "Invalid channel handle"... I'm thinking I need a bit more in there in terms of configuring the TDMS stuff?
0 Kudos
Message 12 of 13
(1,300 Views)
I think I've found the solution to my problem, sort of.  I have separate functions for reading data from the DAQ and actually recording it, because I was interested in displaying the data on screen but not always recording it.  If I combine both functions I don't have the problem with repetition that I was having.  I think I can tweak things around a bit to fix it and still separate the two activities.
0 Kudos
Message 13 of 13
(1,299 Views)