Discussion:
Cold Junction Compensation. CJC and the SCB-68 Box wiring and DAQmx CVI8.5
(too old to reply)
rawpaw
2008-07-31 21:10:09 UTC
Permalink
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>
Paul C.
2008-08-01 16:10:08 UTC
Permalink
Hi Rawpaw, You're correct in most of your assumptions.&nbsp; There are a few knowledge base articles that collectively have some of this information and some additional information.&nbsp; The first article, <a href="http://digital.ni.com/public.nsf/websearch/7F2EA1FE43537A0E8625652200522718" target="_blank">here</a>, discusses some simple troubleshooting and setup to verify a thermalcouple works with the CJC.&nbsp;&nbsp; Theres some information on the switches <a href="http://digital.ni.com/public.nsf/allkb/C75516DB22DC700B8625693B0054B156?OpenDocument" target="_blank">here</a>.&nbsp; There is some information on reading your built-in CJC value <a href="http://digital.ni.com/public.nsf/websearch/16F71843CC7892D4C1256BE3004E1043?OpenDocument" target="_blank">here</a>.&nbsp; In addition, I believe the article your mentioning that has the overall setup information can be found <a href="http://digital.ni.com/public.nsf/allkb/96B996BAD82A84E9862570690066B03F?OpenDocument" target="_blank">here</a>.&nbsp; The NI-DAQmx C Reference help (Start » Programs » National Instruments » NI-DAQ) under the NI-DAQmx C Functions » Channel Configuration /Creation » Create Analog Input Channels » DAQmxCreateAIThrmcplChan explains the difference between built-in and ConstVal for cjcSource.&nbsp; If you specify DAQmx_Val_ConstVal and use the same temperature value (cjcVal) as your actual CJC reads you will get the same results as if you select DAQmx_Val_BuiltIn.&nbsp; If your using the SCB-68, you should select DAQmx_Val_BuiltIn and the cjcVal selected will be ignored (its only used with you select the cjcSource as DAQmx_Val_ConstVal).I hope this helps,Paul C.
Loading...