If the conversion from your sensor to voltage is linear, you can do
the following
Find out the reading of your sensor corresponding to 10V (or the
positive maximum), for example, it is 200lbs
Find out the reading of your sensor at 0V, say 0lb
The reading will become:
Weight= 200 * (ADReading >>4)/2048
--- In ultimaserial_group@yahoogroups.com, "Mike Stephans"
<mike015@...> wrote:
>
> I have a DI158 and have put together some functional code, But I have
> not quite figured out how to adjust for full scale. The following
> comes from
>
http://www.ultimaserial.com/standard.html#To%20convert%20the%20AD%20Readings
>
> For DI-158 :
>
> Voltage = (FullScale/Gain) * (ADReading >>4)/2048
>
> where >>4 means to shift the data to the right for 4 bits. In VB,
> you can use INT (ADReading/16)
>
> I don't follow how to put this into practice.
> This is what I currently have which came from one of the examples.
>
> For i = 0 To Count - 1 Step UltimaSerial.ChannelCount
> For j = 0 To UltimaSerial.ChannelCount - 1
> ActiveSheet.Cells(CellIndex, j + 1) = Format$(buffer(i+ j) /
> 3276.8, "0.00")
> Next j
> CellIndex = CellIndex + 1 'next row
> Next i
>
> I am not looking to use volts as my units I am planning to use a
> custom scale.
> the 0to10v has a corresponding -6to14inches scale. and a gain of 1
> I expect the adjustment to be in the "Format$(buffer..." area.
>
> Thanks for any input.
> Mike
>