Difference between revisions of "Input output formats"
Uwe Hermann (talk | contribs) m |
Uwe Hermann (talk | contribs) m |
||
Line 3: | Line 3: | ||
=== Logic analyzer === | === Logic analyzer === | ||
Getting data directly from a logic analyzer device. | |||
=== | === sigrok session === | ||
The sigrok session file format (*.sr). | |||
See [[Input output formats/sigrok session]] for the file format specification. | |||
=== ChronoVu LA8 === | |||
See [[Input output formats | See [[Input output formats#ChronoVu_LA8_2|below]]. | ||
=== | === Binary === | ||
Raw, binary input format without any metadata. | |||
== Output formats == | == Output formats == | ||
Line 23: | Line 23: | ||
=== sigrok session === | === sigrok session === | ||
The sigrok session file format (*.sr). This is the default (and recommended) format to save dumps to file. | |||
=== Bits === | === Bits === | ||
<small> | <small> | ||
$ '''sigrok-cli --samples 1000 - | $ '''sigrok-cli --samples 1000 -O bits''' | ||
Acquisition with 8/8 probes at 200 KHz | Acquisition with 8/8 probes at 200 KHz | ||
1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | 1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | ||
Line 52: | Line 52: | ||
<small> | <small> | ||
$ '''sigrok-cli -d 0 --time 10 -p 1,2 - | $ '''sigrok-cli -d 0:samplerate=1M --time 10 -p 1,2 -O ascii''' | ||
Acquisition with 2/16 probes at 1 MHz | Acquisition with 2/16 probes at 1 MHz | ||
1:/""""""""\.........../""""""""\.........../""""""""\.........../""""""""\. | 1:/""""""""\.........../""""""""\.........../""""""""\.........../""""""""\. | ||
Line 69: | Line 69: | ||
<small> | <small> | ||
$ '''sigrok-cli --samples 1000 - | $ '''sigrok-cli --samples 1000 -O hex''' | ||
Acquisition with 8/8 probes at 200 KHz | Acquisition with 8/8 probes at 200 KHz | ||
1:ff ff ff ff ff ff ff ff | 1:ff ff ff ff ff ff ff ff | ||
Line 95: | Line 95: | ||
<small> | <small> | ||
$ '''sigrok-cli --samples 1000 - | $ '''sigrok-cli --samples 1000 -O binary > somefile.dat''' | ||
$ '''hexdump -Cv somefile.dat''' | $ '''hexdump -Cv somefile.dat''' | ||
00000000 bf bf bf bf bf bf bf bf bf bf bf bf bf bf bf bf |................| | 00000000 bf bf bf bf bf bf bf bf bf bf bf bf bf bf bf bf |................| | ||
Line 109: | Line 109: | ||
<small> | <small> | ||
$ '''sigrok-cli --samples 1000 - | $ '''sigrok-cli --samples 1000 -O vcd''' | ||
$date Wed Apr 2 00:01:40 2011 $end | $date Wed Apr 2 00:01:40 2011 $end | ||
$version sigrok 0.2 $end | $version sigrok 0.2 $end | ||
Line 156: | Line 156: | ||
<small> | <small> | ||
$ '''sigrok-cli --samples 1000 - | $ '''sigrok-cli --samples 1000 -O gnuplot''' | ||
# Sample data in space-separated columns format usable by gnuplot | # Sample data in space-separated columns format usable by gnuplot | ||
# | # | ||
Line 189: | Line 189: | ||
<small> | <small> | ||
$ '''sigrok-cli -d demo: | $ '''sigrok-cli -d demo:pattern=random --samples 1000 -O ols''' | ||
;Rate: 200000 | ;Rate: 200000 | ||
;Channels: 8 | ;Channels: 8 | ||
Line 222: | Line 222: | ||
<small> | <small> | ||
$ '''sigrok-cli -d 0 --samples 1000 - | $ '''sigrok-cli -d 0 --samples 1000 -O chronovu-la8 -o foo.kdt''' | ||
</small> | </small> | ||
'''Limitations:''' | '''Limitations:''' | ||
* The file size must be exactly 8388613 bytes (8 MB samples + 5 bytes metadata). | * The file size must be exactly 8388613 bytes (8 MB samples + 5 bytes metadata). |
Revision as of 20:20, 14 April 2012
Input formats
Logic analyzer
Getting data directly from a logic analyzer device.
sigrok session
The sigrok session file format (*.sr).
See Input output formats/sigrok session for the file format specification.
ChronoVu LA8
See below.
Binary
Raw, binary input format without any metadata.
Output formats
sigrok session
The sigrok session file format (*.sr). This is the default (and recommended) format to save dumps to file.
Bits
$ sigrok-cli --samples 1000 -O bits Acquisition with 8/8 probes at 200 KHz 1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 2:00000000 00011111 11111111 11100000 00000000 00011111 11111111 11110000 3:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 4:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 5:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 6:01111000 01001100 01111100 01100000 00011100 01101100 00011100 00100011 7:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 8:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 2:00000000 00001111 11111111 11110000 00000000 00000111 11111111 11111000 3:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 4:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 5:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 6:00011110 00100111 00001110 00110000 01001110 00110010 01101110 00010000 7:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 8:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 [...]
ASCII
$ sigrok-cli -d 0:samplerate=1M --time 10 -p 1,2 -O ascii Acquisition with 2/16 probes at 1 MHz 1:/""""""""\.........../""""""""\.........../""""""""\.........../""""""""\. 2 :........../"""""""""""""""""""\...................../"""""""""""""""""""\. 1:........./"""""""""\........../"""""""""\........../"""""""""\........../" 2:..................../"""""""""""""""""""\..................../"""""""""""" 1:""""""""\........../""""""""\.........../""""""""\.........../""""""""\... 2:"""""""\...................../"""""""""""""""""""\...................../"" 1:......../""""""""\........../"""""""""\........../"""""""""\........../""" 2:"""""""""""""""""\...................../"""""""""""""""""""\.............. 1:""""""\........../"""""""""\........../""""""""\.........../""""""""\..... 2:....../"""""""""""""""""""\...................../"""""""""""""""""""\.....
Hex
$ sigrok-cli --samples 1000 -O 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 [...]
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.
$ sigrok-cli --samples 1000 -O 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 |................| [...]
VCD (Value Change Dump)
$ sigrok-cli --samples 1000 -O vcd $date Wed Apr 2 00:01:40 2011 $end $version sigrok 0.2 $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& [...] $dumpoff $end
Gnuplot
$ sigrok-cli --samples 1000 -O gnuplot # Sample data in space-separated columns format usable by gnuplot # # Generated by: sigrok 0.2 on Fri Apr 15 20:25:58 2011 # Comment: Acquisition with 8/8 probes at 500 kHz # Period: 500 ms # # Column Probe # ----------------------------------------------------------------------------- # 0 Sample counter (for internal gnuplot purposes) # 1 1 # 2 2 # 3 3 # 4 4 # 5 5 # 6 6 # 7 7 # 8 8 0 1 0 1 1 1 0 1 1 6 1 0 1 1 1 1 1 1 11 1 0 1 1 1 0 1 1 14 1 0 1 1 1 1 1 1 [...]
OLS
The OLS file format, as supported by jawi's "Alternative" OLS client (>= 0.9.4-rc1).
$ sigrok-cli -d demo:pattern=random --samples 1000 -O ols ;Rate: 200000 ;Channels: 8 ;EnabledChannels: -1 ;Compressed: true ;CursorEnabled: false 00000067@0 000000c6@1 00000069@2 00000073@3 00000051@4 000000ff@5 0000004a@6 000000ec@7 00000029@8 000000cd@9 000000ba@10 000000ab@11 000000f2@12 000000fb@13 000000e3@14 00000046@15 0000007c@16 [...]
ChronoVu LA8
This is the file format understood by the ChronoVu LA8 software. The usual file name extension is .kdt.
$ sigrok-cli -d 0 --samples 1000 -O chronovu-la8 -o foo.kdt
Limitations:
- The file size must be exactly 8388613 bytes (8 MB samples + 5 bytes metadata).