rawpaw
2008-07-31 21:10:09 UTC
Cold Junction Compensation. CJC and the SCB-68 Box
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
DAQmxCreateTask("",&task_TC);
DAQmxCreateAIThrmcplChan (task_TC, "Dev1/ai0", "", 0.0, 50, DAQmx_Val_DegC, DAQmx_Val_T_Type_TC, DAQmx_Val_BuiltIn, 25.0, ""); //CJC port
DAQmxCreateAIThrmcplChan (task_TC, "Dev1/ai1", "", -40.0, 150.0, DAQmx_Val_DegC, DAQmx_Val_T_Type_TC, DAQmx_Val_ConstVal, 25.0, "");
DAQmxCfgSampClkTiming (task_TC, "OnboardClock", 1000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 1000);
DAQmxStartTask(task_TC);
DAQmxReadAnalogF64 (task_TC, DAQmx_Val_Auto, 10.0, DAQmx_Val_GroupByChannel, tc_temp, 3, &actualSamplesRead, 0);
DAQmxStopTask (task_TC);
DAQmxClearTask(task_TC);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Using SCB-68 Box, PCI ? 6221 DAQ card and CVI 8.5.
CJC is connected to ACH0. This is well documented.
Apparently you do not hook up anything to ACH0 but do set S3, 4 and 5 inside the SCB-68 for CJC. The switches are well documented.
It does not look like you have to set the 6221 DAQ card in MAX to assign ACH0 to be a CJC under ?properties?. This was eluded to in some of the discussions but did not seem to make any difference if it was set or not.
It apparently doesn?t care what the thermal couple type is for the ?DAQmxCreateAIThrmcplChan? above for the CJC.
It did not seem to make any difference if you selected ?DAQmx_Val_BuiltIn, 25.0? or DAQmx_Val_ConstVal, 25.0 for the CJC.
It apparently does the compensation all by itself on ACH1 or the Analog input that you select for your thermalcouple. Apparently it will compensate all thermal couples that you assign.
If there is any thing that is not correct with the above, corrections would be appreciated.
Some of this stuff could have been included in the SCB-68 documentation.
The following link is no longer valid in case you point me in that direction.
<a href="http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/5ca3a774944ddbd8862564eb0060234b?OpenDocument" target="_blank"> How Can I Address and Use Cold Junction Compensation (CJC)</a>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
DAQmxCreateTask("",&task_TC);
DAQmxCreateAIThrmcplChan (task_TC, "Dev1/ai0", "", 0.0, 50, DAQmx_Val_DegC, DAQmx_Val_T_Type_TC, DAQmx_Val_BuiltIn, 25.0, ""); //CJC port
DAQmxCreateAIThrmcplChan (task_TC, "Dev1/ai1", "", -40.0, 150.0, DAQmx_Val_DegC, DAQmx_Val_T_Type_TC, DAQmx_Val_ConstVal, 25.0, "");
DAQmxCfgSampClkTiming (task_TC, "OnboardClock", 1000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 1000);
DAQmxStartTask(task_TC);
DAQmxReadAnalogF64 (task_TC, DAQmx_Val_Auto, 10.0, DAQmx_Val_GroupByChannel, tc_temp, 3, &actualSamplesRead, 0);
DAQmxStopTask (task_TC);
DAQmxClearTask(task_TC);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Using SCB-68 Box, PCI ? 6221 DAQ card and CVI 8.5.
CJC is connected to ACH0. This is well documented.
Apparently you do not hook up anything to ACH0 but do set S3, 4 and 5 inside the SCB-68 for CJC. The switches are well documented.
It does not look like you have to set the 6221 DAQ card in MAX to assign ACH0 to be a CJC under ?properties?. This was eluded to in some of the discussions but did not seem to make any difference if it was set or not.
It apparently doesn?t care what the thermal couple type is for the ?DAQmxCreateAIThrmcplChan? above for the CJC.
It did not seem to make any difference if you selected ?DAQmx_Val_BuiltIn, 25.0? or DAQmx_Val_ConstVal, 25.0 for the CJC.
It apparently does the compensation all by itself on ACH1 or the Analog input that you select for your thermalcouple. Apparently it will compensate all thermal couples that you assign.
If there is any thing that is not correct with the above, corrections would be appreciated.
Some of this stuff could have been included in the SCB-68 documentation.
The following link is no longer valid in case you point me in that direction.
<a href="http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/5ca3a774944ddbd8862564eb0060234b?OpenDocument" target="_blank"> How Can I Address and Use Cold Junction Compensation (CJC)</a>