maZZoo maZZoo's blog
very low frequency tech postings  -  hard/color_snapshots_from_a_black_n_white_Tektronix_oscilloscope.writeback
    home
    blog
    feed
    eyes
    info

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

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";


0 writebacks

writebacks...

comment...

 
Name:
URL/Email: (optional)
Title: (optional)
Comments:
Save my Name and URL/Email for next time

validate HTML