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