Test and Measurement Forum

adc10_open_unit problem

Post general discussions on using our drivers to write your own software here

adc10_open_unit problem

Postby vadimrok » Tue May 06, 2003 6:12 pm


I've uncovered some strange behavior of the adc10_open_unit function.
When I disconnect the ADC-12 from the parallel port and call adc10_open_unit(...) from my application I get 1 back which means that the function succeeded (Wrong!). All calls to adc10_get_value() after that return 4095. Does it look normal or it is a bug? I want the user to have an ability to see that device is unplugged if this is the case and correct the problem.

Postby markspencer » Thu May 08, 2003 3:23 pm


The function adc10_open_unit return value is not an indication of whether the ADC12 is connected, but if the parallel port can be opened. If the unit is not connected the value returned by adc10_get_value will always be 4096 adc counts, since it has a 12 bit resolution.

If the full voltage range is not required then the value of 4096 could be used as a test, thus if the return value is equal to 4096 then you would know that the unit is not connected.

Best Regards,

Mark Spencer
User avatar
Site Admin
Site Admin
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests