Hello All,
I have traditional C-code in Visual C++ and I added these two lines (plus the necessary lib links and #include and #define lines) from DAQmx to convert channel 5 to a thermocouple channel:
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAIThrmcplChan
(taskHandle,"Dev1/ai5","",0.0,100.0,DAQmx_Val_DegC,DAQmx_Val_T_Type_TC,DAQmx_Val_ConstVal,25.0,""));
The rest of the code following it is traditional legacy c-code such as:
iStatus = DAQ_Rate(dSampRate, iUnits, &iSampTB, &uSampInt);
iStatus = DAQ_Rate(dScanRate, iUnits, &iScanTB, &uScanInt);
iStatus = DAQ_DB_Config(iDevice, iDBmodeON);
iRetVal = NIDAQErrorHandler(iStatus, "DAQ_DB_Config", iIgnoreWarning);
iStatus = SCAN_Sequence_Setup(iDevice, iNumChans, piChanVect, piGainVect, piScanRateDivVect, &iScansPerSeq, &iSampsPerSeq); iRetVal = NIDAQErrorHandler(iStatus, "SCAN_Sequence_Setup", iIgnoreWarning);
...
I am using channels 0-5, the sampling rate is the same on all of them, and only ch.5 needs to be a thermocouple channel (ch.5 has a thermocouple probe attached).
Do I need to add anything else to get the DAQmx lines to work?
My new program compiles, builds, and runs fine, but shows zero on channel 5. The other voltage channels show the correct readings. I have a feeling the DAQmx lines I added are not taking effect. I read somewhere that when adding DAQmx code to traditional C-code, something has to be unregistered then re-registered?
Thanks,
progprogprog
P.S.: The daq card I am using is PCI-6071E.