#!/usr/bin/env perl
use Device::SerialPort;

   my $port = Device::SerialPort->new("/dev/ttyUSB0");
   $port->databits(8);    $port->baudrate(460800);
   $port->parity("none"); $port->stopbits(1);

  $cmd = "++eos 0\r";
  $port->write($cmd);

  $cmd = "++addr 14\r";
  $port->write($cmd);

   $cmd = "SAMPLE HOLD\r";
   $port->write($cmd);
   sleep(1);

   $cmd = "TRIGGER\r";
   $port->write($cmd);
   sleep(1);

   $cmd = "++read\r";
   $port->write($cmd);
   sleep(1);

   my $result = $port->input;
   print $result, "\n";

   $port->close;
   undef $port;
