Jump to content
  • 0

USB-3102 analog output current mismatch


dylanjp

Question

Posted (edited)

Hello,

          I am trying to use the USB-3102 device to generate analog output currents. I followed the C example code, however I cannot get the output currents to match the dac setting. So using the 0-20mA setting, a DAC value of 32768 should yield 10mA. However, I see around 10.50mA. I used to see 12.30mA @ 32768, before I applied fix mentioned further down in this post.

         Now, if I use the InstaCal program with the same DAC value, I get 10mA exactly. This is with a 100 ohm load and 24V supply. So there is something the InstaCal program is configuring that I do not see in the example programs. I did look at the CB.cfg file that instacal generates, and it contains the following config settings:

   Misc Option[0]: 204
   Misc Option[1]: 204
   Misc Option[2]: 204
   Misc Option[3]: 204
   Misc Option[10]: -13344
   Misc Option[11]: 531
   Misc Option[14]: 0
   Misc Option[15]: -13344
   Misc Option[16]: 2

 

So the "204" means MAT0TO20, which sets the DAC to 0 to 20mA range via:

cbSetConfig(BOARDINFO, board_id, chan, BIDACRANGE, MAT0TO20);

I added this call to my example program, and it reduced the error @ 32768 from 12.30mA to 10.50mA. So there is still some config call that I am missing. 

My first question is, what are options 10, 11, 14, 14, and 16. Do they fine tune the range?

Below is a rough pseudocode of my program that sets the output current:

out_type_ch[chan] == AMPS ? range = MA0TO20 : range = UNI10VOLTS;
err_handling = cbSetConfig(BOARDINFO, board_id, chan, BIDACRANGE, range);
///Converts a single precision voltage (or current) value in engineering 
//units to an integer count value. This function is typically used to obtain a data value from a voltage value for output to a D/A with functions such as //cbAOut().
err_handling = cbFromEngUnits(board_id, range, (float)out_value[chan], &output_val_counts[chan]);
err_handling = cbAOut(board_id, chan, range, output_val_counts[chan]);

 

It should be noted that I forced the cbAOut function to use 32768 via hardcoding, so it is NOT an issue with cbFromEngUnits.

Edited by dylanjp
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello @dylanjp.

What is the serial number on the backside label of your USB-3102 device or in InstaCal?

Which version of Windows OS and InstaCal are you using?

This device does not support field calibration.  Do you want to have the device calibrated?

Regarding the options shown in cb.cfg, they are not documented. However,

Option 14 is the simultaneous mode setting, and

Option 16 is the device identifier shown in InstaCal.

 

Regards,

Fausto

Link to comment
Share on other sites

  • 0
Posted (edited)

Hi Fausto,

                Thanks for your response. I think there is a misunderstanding here. If you read my post again, the issue is not that the device isn't calibrated. The problem is that the InstaCal software can output a DAC value (let's say 32768) and I see the exact output current I would expect, 10mA (0 to 20 mA range). However, if I use the C++ code above (which is based on the example code), the output current will always be off by an amount. So, 32768 will yield 10.50mA, and so on. There is clearly a SW difference in commanding between InstaCal and my program that is based on the examples. This is using the same board and current output setup for both softwares, so this is not a board issue.

                There is no way to see the InstalCal source code, so I don't what it is doing to make the output values match the DAC values. Only thing I have to go by is the config file, and that is why I was asking what those undocumented values were.

                 If I can figure out what InstaCal is doing to make 32768 = 10mA with a 0to20ma range, then we can use this board for current outputs in future projects. If we cannot, then being off by several mA is unacceptable.

                  What are options 10, 11, and 14? Are those some kind of offset coefficients?

Edited by dylanjp
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...