Test and Measurement Forum

function adc2m

Post your VB and VBA discussions here

function adc2m

Postby john.hestia » Thu Nov 17, 2011 10:17 pm

Function adc2mV(value As Long) As Long

' calculate value depending on number of bits
adc2mV = value * 2500000# / 8388608

End Function


Hi to Anyone,

Please explain what is the meaning of function above, appreciate your prompt reply.
john.hestia
Newbie
 
Posts: 0
Joined: Wed Nov 09, 2011 11:53 am

Re: function adc2m

Postby Martyn » Fri Nov 18, 2011 12:02 pm

It will be converting the AD count from the device to a voltage according to the chosen range. 8388608 the maximum value for the number of bits (24 bit), and 2500000 is related to the range (+- 2.5V) which someone has hard coded in.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: function adc2m

Postby john.hestia » Sat Nov 19, 2011 10:57 am

Thank you very much Martyn!
john.hestia
Newbie
 
Posts: 0
Joined: Wed Nov 09, 2011 11:53 am


Return to VB and VBA (Excel, Access)

Who is online

Users browsing this forum: No registered users and 0 guests