Bug 700 - Applying a measure factor to data read from ut71c
Summary: Applying a measure factor to data read from ut71c
Status: RESOLVED FIXED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Driver: uni-t-dmm (show other bugs)
Version: unreleased development snapshot
Hardware: x86 Linux
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-11 09:12 CET by arek.merta
Modified: 2017-05-21 18:25 CEST (History)
2 users (show)



Attachments
A picture of ut71c taking measures from 100nF cap and sigrok output (129.95 KB, image/jpeg)
2015-11-11 09:12 CET, arek.merta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description arek.merta 2015-11-11 09:12:23 CET
Created attachment 184 [details]
A picture of ut71c taking measures from 100nF cap and sigrok output

Overview:
--------
there seems to be some issue with measures received from the uni-t ut71c multimeter. 
Say the multimeter is set to measure capacity (C) and the cap is 22uF.
$ sigrok-cli --version
sigrok-cli 0.6.0-git-1ef118a
Using libsigrok 0.4.0-git-e5ef649 (lib version 2:0:0).
Using libsigrokdecode 0.4.0-git-c63f5a8 (lib version 2:0:0).
...

$sigrok-cli --driver=uni-t-ut71c:conn=1a86.e008 --continuous
...
P1: 0.000021 

Increased level of logging:
$sigrok-cli --driver=uni-t-ut71c:conn=1a86.e008 --continuous -l 4  
sr: [00:19.679655] uni-t-dmm: DMM packet:   32 31 31 39 38 34 35 30 31 0d 0a 00 00 00
sr: [00:19.679714] ut71x: Applying factor 0.000000, new value is 0.000021.

The captured frame can be decoded into:
display: 2 1 1 9 8 
range: 4 (40uF)
function: 5
ac/dc: 0 
auto: 1 (auto) 
end of frame: \r \n

I suspect that the the 'factor' strips most of the data leaving 0.000021. 
However, In case of 100nF ceramic cap (marking 104), I got:
$sigrok-cli --driver=uni-t-ut71c:conn=1a86.e008 --continuous
...
P1: 0.000000

Increasing the logging level:
$sigrok-cli --driver=uni-t-ut71c:conn=1a86.e008 --continuous -l 4  
 
...
cli: Received SR_DF_ANALOG (1 samples).
P1: 0.000000 F AUTO
sr: [01:26.748079] uni-t-dmm: DMM packet:   31 31 32 36 32 32 35 30 31 0d 0a 00 00 00
sr: [01:26.748108] ut71x: Applying factor 0.000000, new value is 0.000000.
sr: [01:26.748121] session: bus: Received SR_DF_ANALOG packet (1 samples).

The captured frame can be decoded into:
display: 1 1 2 6 2 
range: 2 (400nF)
function: 5 (C)
ac/dc: 0 
auto: 1 (auto) 
end of frame: \r \n

In this case, it seems that the 'factor' dropped the reading down to 0, which is not quite true. I have compiled all the libs from the source.

Steps to Reproduce
------------------
Set the meter to measure capacitance, auto-range, connect to pc, enter send mode; connect 100nF ceramic cap and measure

Actual Results 
---------------
P1: 0.000000 F AUTO

Expected Results
----------------
Results as sent by the meter

Build Version
-------------
$ sigrok-cli --version
sigrok-cli 0.6.0-git-1ef118a
Using libsigrok 0.4.0-git-e5ef649 (lib version 2:0:0).
Using libsigrokdecode 0.4.0-git-c63f5a8 (lib version 2:0:0).


Regards,
Arek
Comment 1 Uwe Hermann 2017-05-21 18:25:29 CEST
AFAICS this was a mere printing bug, the protocol parsing per se was working correctly.

The printing has been fixed due to unrelated changes in the mean time. The last remaining issue in one of the debug messages is now also fixed in 2b17aeb87453b956ff686c6393fa688adbc9e0b9, thanks!

    Old:
    ut71x: Applying exponent -12, new value is 0.000000.
    P1: 1.500 nF AUTO
    P1: 1.500 nF AUTO
    
    New:
    ut71x: Applying exponent -12, new value is 1.5e-09.
    P1: 1.500 nF AUTO
    P1: 1.500 nF AUTO

I've tested a few different capacitors, all ranges seemed to produce usable results.