03-08-2015 05:02 PM
I'm also not sure where the actual temperature readings from the thermocouple is stored in this program. The Read in the example looks like this:
int32 error=0;
char errBuff[2048]={'\0'};
static int totalRead=0;
int32 read=0;
float64 data[1000];
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,-1,10.0,DAQmx_Val_GroupByScanNumber,data,1000,&read,NULL));
if( read>0 ) {
printf("Acquired %d samples. Total %d\r",read,totalRead+=read);
fflush(stdout);
}
Are the temperatures being stored in the data array? I tried printing the first element (data[0]) but it comes out as a very large number, I'm sure if this number is supposed to represent the temperature in some way.
03-09-2015 09:23 AM
Hi TimCast,
To verify if you are getting correct measurements, you can use NI MAX and create a task on it. The following link will show you how to do it.
http://www.ni.com/getting-started/set-up-hardware/data-acquisition/thermocouples
I also want to show you the article that can guide you a little more with Text Based DAQmx examples. In here, you should be able to select which Text Based Language you are using and understand better the coding for them.
http://www.ni.com/example/6999/en/
Luis C.
National Instruments