Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading NI 9203 module in cDAQ-9178 chassis using VB6

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.

 

Code Comparison.png

Regards,


h_baker
National Instruments
Applications Engineer
0 Kudos
Message 11 of 14
(3,545 Views)

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...

0 Kudos
Message 12 of 14
(3,535 Views)

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...

0 Kudos
Message 13 of 14
(3,535 Views)

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!

Gary P.
Applications Engineer
National Instruments
0 Kudos
Message 14 of 14
(3,514 Views)