On Sun, Aug 21, 2016 at 10:05:53PM +0000, Mike Meyer wrote: > On Sun, Aug 21, 2016 at 11:56 AM Aurelien Jacobs <[email protected]> wrote: > > > On Fri, Aug 19, 2016 at 03:36:18PM +0000, Mike Meyer wrote: > > > I'm a bit confused by the two formatting options for analog ouput - at > > > least as implemented by the analog output module. > > > > > > The setting is for "digits", and all that's documented are it's values, > > > "all" or "spec", without saying what they mean. While all presumably > > means > > > all relevant digits, it's not clear what "spec" is short for. > > > > Spec is basically what is specified by the vendor (datasheet). > > With some hardware, we get more effective digits thru the protocol, than > > what the vendor specifies in the datasheet. > > > > See here a patch with a proposed documentation: > > https://github.com/aurelj/libsigrok/commit/d707df > > > > Ok, that makes sense. To me, it seems that they ought to be the same most > of the time if the vendor did a good job with the protocol.
Well, not necessarily. Vendors may design a product with a defined display resolution, but the ADC they use might acutally give slightly more resolution than their product specification. The product will be tested and calibrated for it's displayed resolution, but when transmitting data to a computer, why not transmit the value from the ADC with all its resolution ? The additionnal resolution you get may not be granted, and the additional digit you get may be noisy or whatever, but it's easy enough for the computer to filter out the additionnal digit if you want to rely on the vendor spec only. And in some situations, you can take advantage of this additional resolution, for example to better track a very slow trend. > > > Second, the defaults as set by src/analog:sr_analog_init sets the two > > > values both to 0 and the flag indicating they should be used to TRUE, > > > resulting in the same default behavior of displaying no digits for them > > > both. Most of the hardware devices leave things at this default, which > > > seems pretty useless, the exception being agilent-dmm, and hameg-hmo > > which > > > sets encoding->digits to 0 explicitly. > > > > All the drivers were recently converted to this new analog format which > > include these new "digits" fields. As this information was not present > > in the drivers, they were all set to 0 during the mass conversion. > > > > In other words, the device defaults are another thing that just needs > someone to deal with them. Exactly. > > I've just submitted a patch serie that set correct "digits" value for a > > whole bunch of drivers (but still not all of them): > > https://github.com/aurelj/libsigrok/commits/analog2 > > > > If you care about a driver that is not fixed in my patch serie, feel > > free to fix it yourself, and if it is already fixed, it would be nice if > > you could test it with your hadware. > > > > Seems to work fine on my uni-t ut61e. Great ! > However, seeing it output such a long string of 0s in µA mode makes me > think we want to use a g format. Actually, I would like to get a nicer output which takes advantage of this digits field to convert to SI prefix. So insted of this, you would get this: vvvv vvvv 0.0000034 A (digits=7) 3.4 µA 127800 Ω (digits=-2) 127.8 kΩ Aurel ------------------------------------------------------------------------------ _______________________________________________ sigrok-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sigrok-devel

