Difference between revisions of "Input output formats"

From sigrok
Jump to navigation Jump to search
m
(STF import is supported)
(46 intermediate revisions by 9 users not shown)
Line 1: Line 1:
== Input formats ==
[[libsigrok]] supports a number of different input modules (a.k.a. file formats) and output modules, and has a generic API which allows easily adding more input/output modules.


=== Logic analyzer ===
== Supported input/output formats ==


TODO
{| border="0" style="font-size: smaller" class="alternategrey sortable sigroktable"
|-
! style="width: 12em;" | Name
!Input
!Output
!Description
|-
| [[File format:analog|Analog]]
| bgcolor="yellow" | —
| bgcolor="lime" | supported
| Text output of analog data and types.
|-
| [[File format:ascii|ASCII]]
| bgcolor="yellow" | —
| bgcolor="lime" | supported
| ASCII art.
|-
| [[File format:binary|Binary]]
| bgcolor="lime" | supported
| bgcolor="lime" | supported
| Raw binary data output without any metadata attached.
|-
| [[File format:bits|Bits]]
| bgcolor="yellow" | —
| bgcolor="lime" | supported
| 0/1 digits.
|-
| style="white-space: nowrap;" | [[File format:chronovu_la8|ChronoVu LA8]]
| bgcolor="lime" | supported
| bgcolor="lime" | supported
| [[ChronoVu LA8]] software file format (usually with .kdt file extension).
|-
| [[File format:csv|CSV]]
| bgcolor="lime" | supported
| bgcolor="lime" | supported
| Comma-separated values (also usable for generating data and config files for gnuplot).
|-
| [[File format:hex|hex]]
| bgcolor="yellow" | —
| bgcolor="lime" | supported
| Hexadecimal digits.
|-
| [[File format:logicport|Intronix Logicport LA1034]]
| bgcolor="lime" | supported
| bgcolor="yellow" | —
| [[Intronix Logicport LA1034]] *.lpf files.
|-
| [[File format:ols|ols]]
| bgcolor="yellow" | —
| bgcolor="lime" | supported
| The file format used by the [http://www.lxtreme.nl/ols/ "Alternative" Java client] for the [[Openbench Logic Sniffer]].
|-
| [[File format:saleae|saleae]]
| bgcolor="lime" | supported
| bgcolor="yellow" | —
| Files exported by the Saleae Logic application.
|-
| [[File format:srzip|srzip]]
| bgcolor="lime" | supported
| bgcolor="lime" | supported
| The current (v2) sigrok session file format (*.sr).
|-
| [[File format:stf|STF]]
| bgcolor="lime" | supported
| bgcolor="yellow" | —
| "Sigma Test File". Native format of the Asix Sigma/Omega vendor software.
|-
| [[File format:vcd|VCD]]
| bgcolor="lime" | supported
| bgcolor="lime" | supported
| The [http://en.wikipedia.org/wiki/Value_change_dump Value Change Dump] format (can also be visualized in [http://gtkwave.sourceforge.net/ gtkwave], for instance).
|-
| [[File format:wav|WAV]]
| bgcolor="lime" | supported
| bgcolor="lime" | supported
| The [http://en.wikipedia.org/wiki/WAV waveform audio] (WAV) file format.
|-
| [[File format:raw_analog|Raw analog]]
| bgcolor="lime" | supported
| bgcolor="yellow" | —
| Analog signals without header (configurable sample size, format, and endianness).


=== sigrok session ===
|-
| [[File format:trace32_ad|Lauterbach Trace32]]
| bgcolor="lime" | supported
| bgcolor="yellow" | —
| The Lauterbach Trace32 logic analyzer data file format.


TODO
|-
| [[File format:wavedrom|WaveDrom]]
| bgcolor="yellow" | —
| bgcolor="lime" | supported
| Digital timing diagrams in JSON syntax


== Output formats ==
|}


=== sigrok session ===
== Supported transform modules ==


TODO
{| border="0" style="font-size: smaller" class="alternategrey sortable sigroktable"
|-
! style="width: 8em;" | Name
!Description
|-
| nop
| Do nothing.
|-
| scale
| Scale analog values by a specified factor.
|-
| invert
| Invert values.
|}


=== ASCII bits ===
== Possible candidates for future input/output formats ==


<small>
{| border="0" style="font-size: smaller" class="alternategrey sortable sigroktable"
$ '''sigrok-cli --samples 1000 -f bits'''
|-
Acquisition with 8/8 probes at 200 KHz
!Name
1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
!Description
2:00000000 00011111 11111111 11100000 00000000 00011111 11111111 11110000
|-
3:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
| Scanalogic
4:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
| Used by the [[IKALOGIC Scanalogic-2]] and [[IKALOGIC ScanaPLUS]] logic analyzers.
5:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
|-
6:01111000 01001100 01111100 01100000 00011100 01101100 00011100 00100011
| [[File format:rigol_rof|Rigol ROF]]
7:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
| Used by the [[Rigol DP800 series]] power supplies.
8:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
|-
1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
| [[File format:rigol_raf|Rigol RAF]]
2:00000000 00001111 11111111 11110000 00000000 00000111 11111111 11111000
| Used by the Rigol DG1000Z, DG4000, and DG5000 series signal generators. See [http://www.batronix.com/pdf/Rigol/UserGuide/DG1000Z_UserGuide_EN.pdf DG1000Z User Guide] page 2-75, also [http://www.eevblog.com/forum/testgear/rigol-dg4000-series-raf-file-format/msg559443/ this post] at eevblog.
3:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
|-
4:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
| [[File format:rigol_wfm|Rigol WFM]]
5:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
| Used by the Rigol DS series oscilloscopes. See https://github.com/mabl/pyRigolWFM/blob/master/wfm.py
6:00011110 00100111 00001110 00110000 01001110 00110010 01101110 00010000
|-
7:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
| [[File_format:Rigol_WFM4|Rigol WFM4]]
8:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
| Used by the Rigol DS4000 series oscilloscopes.
[...]
|-
</small>
| Vector MDF (v3.3) / ASAM MDF (v4.x)
 
| Automotive industry standard format. Docs can be found [http://vector.com/vi_mdf_de.html here] and [http://vector.com/downloads/mdf_specification.pdf here]. Validator is [http://vector.com/downloads/MDFValidator2.1.8.zip here]. Some code is [https://code.google.com/p/mdfreader/ here] and [http://sourceforge.net/p/mdfdatafile/code/HEAD/tree/ here].
=== ASCII ===
|-
 
| [http://en.wikipedia.org/wiki/Comtrade COMTRADE]
<small>
| File format used by devices in power engineering (e.g. protective relays, fault recorders). Can contain digital and analog data with constant or variable sample rate.
$ '''sigrok-cli -d 0 --time 10 -p 1,2 -o samplerate=1M -f ascii'''
|-
Acquisition with 2/16 probes at 1 MHz
| [[File format:pwl|PWL]]
1:/""""""""\.........../""""""""\.........../""""""""\.........../""""""""\.
| Trivial file format that can be used to define the signal of voltage/current sources in a SPICE simulation.
2 :........../"""""""""""""""""""\...................../"""""""""""""""""""\.
|-
1:........./"""""""""\........../"""""""""\........../"""""""""\........../"
| [[File format:tektronix_wfm|Tektronix WFM]]
2:..................../"""""""""""""""""""\..................../""""""""""""
| Used by the Tektronix TDS series oscilloscopes. A parser for Matlab can be found [http://www.mathworks.com/matlabcentral/fileexchange/5873-tektronix-binary-file-readers/content/wfmread.m here].
1:""""""""\........../""""""""\.........../""""""""\.........../""""""""\...
|-
2:"""""""\...................../"""""""""""""""""""\...................../""
| EVCD/IDX/FST/GHW
1:......../""""""""\........../"""""""""\........../"""""""""\........../"""
| File formats generated by hardware simulation tools. See the [http://gtkwave.sourceforge.net/gtkwave.pdf GtkWave manual] for some of them, and conversion utilities.
2:"""""""""""""""""\...................../"""""""""""""""""""\..............
|-
1:""""""\........../"""""""""\........../""""""""\.........../""""""""\.....
| [https://www.ni.com/hu-hu/support/documentation/supplemental/06/the-ni-tdms-file-format.html NI TDMS]
2:....../"""""""""""""""""""\...................../"""""""""""""""""""\.....
| File formats used by various National Instruments software like LabVIEW or DAQExpress.
</small>
|-
 
| IMC data format
=== hex ===
| File formats used by imc GmbH softwares. File format description can be found in the [https://www.imcdataworks.com/secure-dl/?file=fileadmin/Download-Center/Manuals/imc_FAMOS/imcSharedComponents.pdf imc Software Shared Components documentation]. (Registration required.)
 
|}
<small>
$ '''sigrok-cli --samples 1000 -f hex'''
Acquisition with 8/8 probes at 200 KHz
1:ff ff ff ff ff ff ff ff
2:00 7f ff c0 00 3f ff c0
3:ff ff ff ff ff ff ff ff
4:ff ff ff ff ff ff ff ff
5:ff ff ff ff ff ff ff ff
6:71 b2 71 8f 70 9f 78 c0
7:ff ff ff ff ff ff ff ff
8:ff ff ff ff ff ff ff ff
1:ff ff ff ff ff ff ff ff
2:00 3f ff e0 00 1f ff e0
3:ff ff ff ff ff ff ff ff
4:ff ff ff ff ff ff ff ff
5:ff ff ff ff ff ff ff ff
6:f8 d8 f8 c0 3c 4c 1c 63
7:ff ff ff ff ff ff ff ff
8:ff ff ff ff ff ff ff ff
[...]
</small>
 
=== Binary ===
 
Raw, binary output format without any metadata. In the example below every byte contains one sample consisting of 8 probe values (each bit denotes the high or low value of one probe; bit 0 corresponds to probe 0, and so on). In the example, probe 6 is tied to GND (i.e., low), all others are high.
 
<small>
$ '''sigrok-cli --samples 1000 -f binary > somefile.dat'''
$ '''hexdump -Cv somefile.dat'''
00000000  bf bf bf bf bf bf bf bf  bf bf bf bf bf bf bf bf  |................|
00000010  bf bf bf bf bf bf bf bf  bf bf bf bf bf bf bf bf  |................|
00000020  bf bf bf bf bf bf bf bf  bf bf bf bf bf bf bf bf  |................|
00000030  bf bf bf bf bf bf bf bf  bf bf bf bf bf bf bf bf  |................|
[...]
</small>
 
=== Value Change Dump (VCD) ===
 
[[File:Sigrok vcd output in gtkwave.png|thumb|320px|right|sigrok VCD output viewed in gtkwave]]
 
<small>
$ '''sigrok-cli --samples 1000 -f vcd'''
$date
  TODO
$end
$version
  sigrok 0.1pre
$end
$comment
  Acquisition with 8/8 probes at 200 KHz
$end
$timescale
  1 ns
$end
$scope module sigrok $end
$var wire 1 ! channel1 $end
$var wire 1 " channel2 $end
$var wire 1 # channel3 $end
$var wire 1 $ channel4 $end
$var wire 1 % channel5 $end
$var wire 1 & channel6 $end
$var wire 1 ' channel7 $end
$var wire 1 ( channel8 $end
$upscope $end
$enddefinitions $end
$dumpvars
#0
1!
#0
0"
#0
1#
#0
1$
#0
1%
#0
0&
#0
1'
#0
1(
#3
1&
#8
0&
#11
1&
#13
1"
#13
0&
[...]
$dumpoff
$end
</small>
 
=== Gnuplot ===
 
[[File:Sigrok gnuplot output.png|thumb|right|320px|sigrok gnuplot output format, PNG format]]
 
<small>
$ '''sigrok-cli --samples 1000 -f gnuplot'''
# Sample data in space-separated columns format usable by gnuplot
#
# Generated by: sigrok 0.1pre on TODO
# Comment: Acquisition with 8/8 probes at 200 KHz
# Timescale: 1 ns
# Column assignment:
# Column 0: channel 1
# Column 1: channel 2
# Column 2: channel 3
# Column 3: channel 4
# Column 4: channel 5
# Column 5: channel 6
# Column 6: channel 7
# Column 7: channel 8
0              1 0 1 1 1 0 1 1
1              1 0 1 1 1 0 1 1
2              1 0 1 1 1 0 1 1
3              1 0 1 1 1 0 1 1
4              1 0 1 1 1 0 1 1
5              1 0 1 1 1 0 1 1
6              1 0 1 1 1 1 1 1
7              1 0 1 1 1 1 1 1
8              1 0 1 1 1 1 1 1
9              1 0 1 1 1 1 1 1
10              1 0 1 1 1 1 1 1
11              1 0 1 1 1 0 1 1
12              1 0 1 1 1 0 1 1
13              1 0 1 1 1 0 1 1
14              1 0 1 1 1 1 1 1
[...]
</small>
 
== LaTeX ==
[http://www.ctan.org/tex-archive/graphics/pgf/contrib/tikz-timing TODO]

Revision as of 19:58, 20 October 2021

libsigrok supports a number of different input modules (a.k.a. file formats) and output modules, and has a generic API which allows easily adding more input/output modules.

Supported input/output formats

Name Input Output Description
Analog supported Text output of analog data and types.
ASCII supported ASCII art.
Binary supported supported Raw binary data output without any metadata attached.
Bits supported 0/1 digits.
ChronoVu LA8 supported supported ChronoVu LA8 software file format (usually with .kdt file extension).
CSV supported supported Comma-separated values (also usable for generating data and config files for gnuplot).
hex supported Hexadecimal digits.
Intronix Logicport LA1034 supported Intronix Logicport LA1034 *.lpf files.
ols supported The file format used by the "Alternative" Java client for the Openbench Logic Sniffer.
saleae supported Files exported by the Saleae Logic application.
srzip supported supported The current (v2) sigrok session file format (*.sr).
STF supported "Sigma Test File". Native format of the Asix Sigma/Omega vendor software.
VCD supported supported The Value Change Dump format (can also be visualized in gtkwave, for instance).
WAV supported supported The waveform audio (WAV) file format.
Raw analog supported Analog signals without header (configurable sample size, format, and endianness).
Lauterbach Trace32 supported The Lauterbach Trace32 logic analyzer data file format.
WaveDrom supported Digital timing diagrams in JSON syntax

Supported transform modules

Name Description
nop Do nothing.
scale Scale analog values by a specified factor.
invert Invert values.

Possible candidates for future input/output formats

Name Description
Scanalogic Used by the IKALOGIC Scanalogic-2 and IKALOGIC ScanaPLUS logic analyzers.
Rigol ROF Used by the Rigol DP800 series power supplies.
Rigol RAF Used by the Rigol DG1000Z, DG4000, and DG5000 series signal generators. See DG1000Z User Guide page 2-75, also this post at eevblog.
Rigol WFM Used by the Rigol DS series oscilloscopes. See https://github.com/mabl/pyRigolWFM/blob/master/wfm.py
Rigol WFM4 Used by the Rigol DS4000 series oscilloscopes.
Vector MDF (v3.3) / ASAM MDF (v4.x) Automotive industry standard format. Docs can be found here and here. Validator is here. Some code is here and here.
COMTRADE File format used by devices in power engineering (e.g. protective relays, fault recorders). Can contain digital and analog data with constant or variable sample rate.
PWL Trivial file format that can be used to define the signal of voltage/current sources in a SPICE simulation.
Tektronix WFM Used by the Tektronix TDS series oscilloscopes. A parser for Matlab can be found here.
EVCD/IDX/FST/GHW File formats generated by hardware simulation tools. See the GtkWave manual for some of them, and conversion utilities.
NI TDMS File formats used by various National Instruments software like LabVIEW or DAQExpress.
IMC data format File formats used by imc GmbH softwares. File format description can be found in the imc Software Shared Components documentation. (Registration required.)