08-18-2005 02:26 PM
08-19-2005 10:05 AM
Hi Palitha-
The reason you are seeing error 200077 is likely because you are trying to use "built-in CJC" as the option when creating your channels. The NI 6220 only supports constant values and CJC routed through channels on the board. If you are using an SCB-68 terminal block you can route the CJC sensor to either differential or single-ended channel 0 depending on your needs by configuring the switches as indicated in the user manual. A description of how to configure the values for DAQmx_Val_Chan CJC setups is described in the NI-DAQmx C Reference Help (Start>>Programs>>National Instruments>>NI-DAQ)
With NI-DAQmx 7.5 VB 6.0 support was added natively. Examples install in the "C:\Program Files\National Instruments\NI-DAQ\Examples\Visual Basic 6.0" of your local drive. The thermocouple type constants are still listed as the form "DAQmx_Val_X_Type_TC" in the NI-DAQmx C Reference Help and I wasn't aware of a name change in NI-DAQmx 7.5. Where did you find the new constant you're using now?
Hopefully this helps-
08-19-2005 04:24 PM
Hi Tom,
Thanks for your reply. I am using CB-68T with CJC in channel 0. Channel 1 is auto zero. So, the builtin _CJC should be ok, I presume. However, I will give it a try by choosing another channel as a CJC.
Name of Values has been changed and "DAQmx_Val_X_Type_TC" would not work as described in examples giving me undefined variable error. I found it painfully, going through VB6.0 references to the NIDAQmx library. New constants are named DAQmx_Val_ThermocoupleType1_X_Type_TC. in 7.5 version. (I do not know how they are named in the 7.4). I appreciate if any other suggestions to resolve this issue.
Regards
Palitha
08-19-2005 04:33 PM
Hi Palitha-
Yes, your CJC is wired to channel zero directly. This means you will need a create a channel to scan from it and then specify that channel as the CJC source when creating your thermocouple channel rather than using the "built-in" setting.
The enumeration constants are indeed changed in NI-DAQmx 7.5. I wasn't aware of the "change" because VB6.0 wasn't supported directly in previous versions so the C functions were always just called from the dll. According to the VB6.0 help file (Start>>Programs>>National Instruments>>NI-DAQ>>NI-DAQmx C API Visual Basic 6.0 Help) all of the enumeration constants will be different in VB than with the C API directly.
This distinction is described as follows:
The NI-DAQmx C API includes named constants that you use to specify predefined parameter values for some functions. NI-DAQmx C API Visual Basic 6.0 groups these constants into Visual Basic 6.0 enumeration types. The Visual Basic 6.0 editor has built-in support for enumerations. While you are typing a call to a function that is defined in the NI-DAQmx type library, the Visual Basic 6.0 editor recognizes when a parameter is of an enumerated type and displays a list of valid values.
The name of each enumeration value is different than the equivalent NI-DAQmx C API-named constant, even though internally they are both set to the same integer value.
So it seems you were correct- thanks for pointing out the discrepancy for all of us
08-20-2005 12:35 PM
08-20-2005 03:21 PM
Hi Palitha-
As I mentioned in my previous posts you can not use "built-in" as the CJC source option. Your CB-68T has the CJC sensor routed to channel 0 of the card rather than a seperate "_cjtemp" channel that is used for built-in CJC with some cards and terminal blocks. Neither your card nor your terminal block support "built-in" CJC. You must use a seperate channel in your task that accesses channel 0 to scan the CJC sensor and use a "channel" setting for CJC source with the thermocouple channel settings.
There is no problem is creating a thermistor (current excitation) channel in the same task as thermocouple input channels. Simply pass a channel name to the DAQmxCreateAIThrmstrChanIex function for the "nameToAssignToChannel" parameter. Then, when creating a DAQmxCreateAIThrmcplChan in the same task, specify CJC source as channel and CJC channel as the channel name you created for the thermistor channel.
Again, the "built-in" setting for CJC will NOT work under any circumstances with the hardware you are using.
Hopefully this helps-
08-22-2005 05:22 PM
03-11-2009 10:28 PM
An old thread, but it is still helping people, like me, with a PCI-6229 project.
At first I was disappointed to learn that the built_in option was not supported, but then it occurred to me that it makes perfect sense since the thermocouple junctions are going to be made some distance from the 6229 board, and outside the (warm) PC at that.
Thanks.
03-12-2009 01:33 AM
Well, I guess my troubles aren't over.
I can now read temperatures, thanks to the above posts, using the DAQmx_Val_ConstVal cjcSource option, but I want to do this using the DAQmx_Val_Chan option, using a real reference junction. I'm not sure what the general approach should be, and of course nothing I have tried so far works.
Should I be doing this?
1. Create a task that defines the reference channel, say, channel 19 on my 6229 board
2. Define that channel as a thermocouple using the DAQmx_Val_Const option and set cjcVal to 0
3. Create a task that defines the measurement channel, say, channel 20 on my 6229 board
4. Define that channel as a thermocouple channel using the DAQmx_Val_Chan option and pointing to the name of the reference channel in the reference task
5. Connect a short thermocouple to ai19/ai27
6. Read from the measurement task
7. Clear both tasks.
Do I also need to read from the reference channel, even if I'm not using that reading?
Or should I create a single task that includes both channels, and if so, how does that task know which is the reference channel? (Right now I'm doing these reads using DAQmxReadAnalogF64.)
Thanks in advance.
04-27-2009 04:01 PM
Setting this aside for a while helps. When dealing with this problem initially I was so anxious about getting a solution that I read the above too hastily.
I've been using a contact value in the mean time, but I need to fix that. I was thinking I could use another channel as a source, but then I'd still need a way of providing the CJC for that thermocouple. It looks like CJC_Constant ismy only option on a 6229 board.
If I understand correctly, here is what I need to do:
1. Install a thermister across the terminals of a double-ended channel - DAQmxCreateAIResistanceChan
2. Specify internal excitation (DAQmx_Val_Internal) for 2-wire resistance measurements.
3. Convert the resistance reading to a temperature.
4. Use that temperature as the CJC constant value when I read the thermocouple channels.
I'm sure I can find a suitable thermister, but I'm not sure how this internal excitation thing works, or if it will be possible to do 4-wire measurements without using an external source. (All four analog out channels are already being used.)