On Sat, 2020-05-30 at 00:59 -0700, Timo Kokkonen wrote:
>
> I was testing new driver for electronic loads and noticed odd behavior with
> sigrok-cli.
>
> Output seems fine without "-O csv":

There probably are several issues that interact in your setup.
When you just specify the -O format but omit the -o file spec,
your screen may see interleaved output that gets emitted from
several code paths in parallel (and with optional buffering which
additionally garbles the output). In other words the screen
output may differ from a generated output file without the
remaining screen output.

> # ./sigrok-cli -d itech-it8500:conn=/dev/ttyUSB1:serialcomm=38400/8n1 
> --samples 4
> FRAME-BEGIN
> V1: 12.01100 V DC
> I1: 499.60 mA DC
> P1: 6.00000 W DC
> FRAME-END
> [ ... ]
>
> But CSV output seems messed up:
>
> # ./sigrok-cli -d itech-it8500:conn=/dev/ttyUSB1:serialcomm=38400/8n1 
> --samples 4 -O csv
> ; CSV generated by libsigrok 0.6.0-git-7e46c8ec
> ; from ITECH IT8500 series on Sat May 30 00:48:31 2020
> ; Channels (3/3): V1, I1, P1
> ; Samplerate: 10 Hz
>
> V1: 12.01000 V DC
> I1: 499.50 mA DC
> V DC,A DC,W DC
> 12.01,0.4995,5.999
> FRAME-END
>
> [ ... ]

The current implementation of CSV export was created with logic
data in mind. That's what the source code suggests, concentration
on a specific use case, and either assumption that other uses are
not tried, or that they get addressed at a later point in time.

CSV export may work with a single analog channel. But for mixed
signal data, or multiple analog channels, results very probably
are unexpected, and incorrect. That's how I read the comments in
the implementation. The code needs to get extended.

That's a known limitation, has been that way for years, and
nobody has yet gone and done something about it. Developers are
busy and don't use this feature, and users haven't contributed
something better. Which makes me believe that either the feature
is not used in the field, or that users perceive the current lack
of better support as not important enough to do something about
it. Another explanation would be that other output formats are
available as workarounds, or that the CSV output is not used in
combination with analog data types. -- I don't know, as I don't
use CSV myself either. Your guess is as good as mine.

> Is this perhaps something in sigrok-cli, or could it be the driver somehow?

Neither, it's the src/output/csv.c output module.


virtually yours
Gerhard Sittig
--
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to