View Single Post
joerg_rw's Avatar
Posts: 2,222 | Thanked: 12,651 times | Joined on Mar 2010 @ SOL 3
#2263
off topic sidenote: As mentioned in last newsletter, my local lab seen a Rigol DS1054 scope as latest new instrumentation acquisition. Nice tool, and I want to share a handy lil cmdline here for doing screenshots from it:

Code:
jr@saturn:~> cat `which rigol-screenshot `
#!/bin/sh
echo ':disp:data?' | netcat 192.168.4.52 5555 | dd bs=1M iflag=skip_bytes skip=11 of=$1
echo $?
jr@saturn:~> rigol-screenshot xxx.bmp
0+903 Datensätze ein
0+903 Datensätze aus
1152057 Bytes (1,2 MB) kopiert, 2,98393 s, 386 kB/s
0
[edit] improved version, now actually checks TMC header and coverts to arbitrary picture-format target files, just use the proper file ending (.jpg, .bmp, .png...)
Code:
#!/bin/bash
# usage: rigol-snapshot <filename_with_wellknown_imagefile_extension>
#        e.g.: rigol-snapshot pics/test.jpg
#   fetches a bmp formatted screenshot picture from Rigol DS1000 series, via ethernet
# TODO: proper handling of broken connection to Rigol, check netcat / read return code

RIGOL_IP=192.168.4.52   # adapt to your local situation, I used fixed DHCP IP for rigol in my router
set -e -u #might improve the TODO error handling as mentioned above. untested!!

echo ':disp:data?' | netcat -w 1 $RIGOL_IP 5555\
 | (shopt -s extglob;\
    read -N 1 -t 0.1 magichash;
    read -N 1 -t 0.1 lenofnum; 
    read -N $lenofnum -t 0.1 numofbytes; 
    head -c ${numofbytes##*(0)} ; 
    echo "magic: $magichash; len: $lenofnum; bytes: ${numofbytes##*(0)}" >&2\
   )\
 | convert bmp:- $1
echo "returncode: $?" >&2
funny detail: the data transfer is 3 times as fast when the scope is in STOP mode.

ps: don't miss our fine new whitepaper on NFC

Last edited by joerg_rw; 2015-02-05 at 05:49.
 

The Following 8 Users Say Thank You to joerg_rw For This Useful Post: