11-12-2010 05:01 PM
Hi Chris,
I am pleased the hardware is working without issue and hopefully this will take care of the software error so you may successfully move forward. Below is a screenshot comparison of the DAQmx C Reference Help and the current example previously referenced parallel to your line of code. It appears that you are passing a string in place of a number for the shunt resistor value (indicated in red). If a number is expected and a string is passed, then I anticipate this would produce a type mismatch error like you are seeing. Let me know if you are still experiencing difficulty after this substitution.
11-12-2010 05:33 PM
SUCCESS!!! I was under the impression that if you were using the internal shunt resistor in the module itself you did not need to specify a resistor value. You absolutely do. Here is the code that works:
DAQmxErrChk DAQmxCreateAICurrentChan(taskHandle, "cDAQ1Mod2/ai0:7", "", DAQmx_Val_Cfg_Default, 0.003, 0.02, DAQmx_Val_CurrentUnits2_Amps, DAQmx_Val_CurrentShuntResistorLocation1_Internal, 249.0, "")
With that being said, do you happen to know the acutal resistor resistance in the NI 9203 module itself? That is the number I would like to use instead of the default 249.0, if it even matters.
Thanks for all your help on this one...
11-12-2010 05:34 PM
SUCCESS!!! I was under the impression that if you were using the internal shunt resistor in the module itself you did not need to specify a resistor value. You absolutely do. Here is the code that works:
DAQmxErrChk DAQmxCreateAICurrentChan(taskHandle, "cDAQ1Mod2/ai0:7", "", DAQmx_Val_Cfg_Default, 0.003, 0.02, DAQmx_Val_CurrentUnits2_Amps, DAQmx_Val_CurrentShuntResistorLocation1_Internal, 249.0, "")
With that being said, do you happen to know the acutal resistor resistance in the NI 9203 module itself? That is the number I would like to use instead of the default 249.0, if it even matters.
Thanks for all your help on this one...
11-15-2010 02:32 PM
Hi Chris-
The manual does not specify a resistor value. Are you looking for a shunt resistor value? I am unfamiliar with what your application is specifically, but I am fairly sure that would be an external resistor. The 9203 input impedance is 138 Ohms, if that helps.
Have a great day!