maZZoo maZZoo's blog
very low frequency tech postings  -   18 11 2005
    home
    blog
    feed
    eyes
    info

    code [12]
    dect [4]
    hard [8]
    meta [5]
    security [5]

jul 2009 (1)
jun 2009 (1)
jan 2009 (2)
dec 2008 (1)
oct 2008 (1)
jan 2008 (1)
oct 2007 (1)
jun 2007 (1)
feb 2007 (3)
jan 2007 (3)
nov 2006 (2)
aug 2006 (2)
jul 2006 (1)
may 2006 (1)
nov 2005 (2)
oct 2005 (1)
apr 2005 (2)
mar 2005 (2)
feb 2005 (1)
jan 2005 (1)
may 2004 (1)
jan 2004 (1)
apr 2003 (1)
jan 2003 (1)

Fri, 18 Nov 2005

color snapshots from a black n white Tektronix oscilloscope

lucky me owns a Tektronix TDS540 oscilloscope (4 channels, 500MHz BW, 1 GS/s) without floppy drive and BW monitor.
Here's an easy way to create colored .png files from the TDS540 (and probably other TDS series CRO) :

  • connect the TDS to your PC via RS232
  • in the Hardcopy Menu set the printer to "EPS Color Encapsulated Postscript color plot"
  • Layout: Landscape
  • Port: RS232
  • have ghostscript installed on your PC
  • run the perl script TDSsnap (also below)
  • press the HARDCOPY button
  • you should obtain two files TDSsnapshot.eps and TDSsnapshot.png
snapshot from Tektronix TDS540


#!/usr/bin/perl -w

use strict;

my $device="/dev/ttyS7"; # change this to your needs!

print "ensure the Tektronix prints as \"EPS Color /Encapsulated Postscript color plot/\"\n";
print "connect it to $device (for me: Quatech interface D)\n";

open F, "<$device" or die "cannot open $device\n";

print "\npress the HARDCOPY button\n\n";

my $eps="";
my $i=0;

while (<F>){
        s/.*translate 90 rotate$/20.00 20.00 translate/;
        $eps .= $_;
        print "\rEPS line " . $i++;
        last if /^%\%EOF$/;
}

close F or die "cannot close $device\n";

print "\n";

my $outname="TDSsnapshot";

$outname=$ARGV[0] if $ARGV[0];

print "creating $outname.eps\n";


open F, ">$outname.eps" or die "cannot open $outname.eps\n";
print F $eps;

close F or die "cannot close $outname.eps\n";

print "creating $outname.png\n";

open F, "| /usr/bin/gs -sDEVICE=png256 -q -dSAFER -dNOPAUSE -dBATCH -g630x480 -sOutputFile=$outname.png -_"
        or die "cannot pipe into /usr/bin/gs (ghostscript not installed?)\n";
print F $eps;

close F or die "cannot close $outname.eps\n";

print "done.\n";




posted in /hard  |  link  |  comments [0]   


validate HTML